@workos-inc/widgets 1.8.0 → 1.8.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/dist/cjs/api/endpoint.cjs +4 -1
- package/dist/cjs/api/endpoint.cjs.map +1 -1
- package/dist/cjs/api/endpoint.d.cts +17 -9
- package/dist/cjs/experimental/api/fetch.cjs +1083 -0
- package/dist/cjs/experimental/api/fetch.cjs.map +1 -0
- package/dist/cjs/experimental/api/fetch.d.cts +1871 -0
- package/dist/cjs/experimental/api/react-query.cjs +1863 -0
- package/dist/cjs/experimental/api/react-query.cjs.map +1 -0
- package/dist/cjs/experimental/api/react-query.d.cts +2685 -0
- package/dist/cjs/experimental/api/swr.cjs +1972 -0
- package/dist/cjs/experimental/api/swr.cjs.map +1 -0
- package/dist/cjs/experimental/api/swr.d.cts +2585 -0
- package/dist/cjs/lib/add-mfa-dialog.cjs +2 -2
- package/dist/cjs/lib/add-mfa-dialog.cjs.map +1 -1
- package/dist/cjs/lib/admin-portal-domain-verification.cjs.map +1 -1
- package/dist/cjs/lib/api/user.d.cts +2 -2
- package/dist/cjs/lib/api-keys/api-keys-search.cjs +2 -2
- package/dist/cjs/lib/api-keys/api-keys-search.cjs.map +1 -1
- package/dist/cjs/lib/api-keys/create-api-key.cjs +8 -8
- package/dist/cjs/lib/api-keys/create-api-key.cjs.map +1 -1
- package/dist/cjs/lib/change-password-dialog.cjs +18 -18
- package/dist/cjs/lib/change-password-dialog.cjs.map +1 -1
- package/dist/cjs/lib/copy-button.cjs.map +1 -1
- package/dist/cjs/lib/edit-user-profile-dialog.cjs +8 -8
- package/dist/cjs/lib/edit-user-profile-dialog.cjs.map +1 -1
- package/dist/cjs/lib/elements/utils.cjs +3 -4
- package/dist/cjs/lib/elements/utils.cjs.map +1 -1
- package/dist/cjs/lib/elements.cjs.map +1 -1
- package/dist/cjs/lib/elevated-access.cjs +2 -2
- package/dist/cjs/lib/elevated-access.cjs.map +1 -1
- package/dist/cjs/lib/marker.cjs.map +1 -1
- package/dist/cjs/lib/organization-switcher.cjs.map +1 -1
- package/dist/cjs/lib/otp-input.cjs +6 -7
- package/dist/cjs/lib/otp-input.cjs.map +1 -1
- package/dist/cjs/lib/provider-icon.cjs.map +1 -1
- package/dist/cjs/lib/set-password-dialog.cjs +12 -12
- package/dist/cjs/lib/set-password-dialog.cjs.map +1 -1
- package/dist/cjs/lib/status.cjs.map +1 -1
- package/dist/cjs/lib/users-search.cjs +2 -2
- package/dist/cjs/lib/users-search.cjs.map +1 -1
- package/dist/cjs/organization-switcher.client.cjs.map +1 -1
- package/dist/esm/api/endpoint.d.ts +17 -9
- package/dist/esm/api/endpoint.js +4 -1
- package/dist/esm/api/endpoint.js.map +1 -1
- package/dist/esm/experimental/api/fetch.d.ts +1871 -0
- package/dist/esm/experimental/api/fetch.js +954 -0
- package/dist/esm/experimental/api/fetch.js.map +1 -0
- package/dist/esm/experimental/api/react-query.d.ts +2685 -0
- package/dist/esm/experimental/api/react-query.js +1641 -0
- package/dist/esm/experimental/api/react-query.js.map +1 -0
- package/dist/esm/experimental/api/swr.d.ts +2585 -0
- package/dist/esm/experimental/api/swr.js +1731 -0
- package/dist/esm/experimental/api/swr.js.map +1 -0
- package/dist/esm/lib/add-mfa-dialog.js +1 -1
- package/dist/esm/lib/add-mfa-dialog.js.map +1 -1
- package/dist/esm/lib/admin-portal-domain-verification.js.map +1 -1
- package/dist/esm/lib/api/user.d.ts +2 -2
- package/dist/esm/lib/api-keys/api-keys-search.js +1 -1
- package/dist/esm/lib/api-keys/api-keys-search.js.map +1 -1
- package/dist/esm/lib/api-keys/create-api-key.js +1 -1
- package/dist/esm/lib/api-keys/create-api-key.js.map +1 -1
- package/dist/esm/lib/change-password-dialog.js +1 -1
- package/dist/esm/lib/change-password-dialog.js.map +1 -1
- package/dist/esm/lib/copy-button.js.map +1 -1
- package/dist/esm/lib/edit-user-profile-dialog.js +1 -1
- package/dist/esm/lib/edit-user-profile-dialog.js.map +1 -1
- package/dist/esm/lib/elements/utils.js +1 -2
- package/dist/esm/lib/elements/utils.js.map +1 -1
- package/dist/esm/lib/elements.js.map +1 -1
- package/dist/esm/lib/elevated-access.js +1 -1
- package/dist/esm/lib/elevated-access.js.map +1 -1
- package/dist/esm/lib/marker.js.map +1 -1
- package/dist/esm/lib/organization-switcher.js.map +1 -1
- package/dist/esm/lib/otp-input.js +6 -3
- package/dist/esm/lib/otp-input.js.map +1 -1
- package/dist/esm/lib/provider-icon.js.map +1 -1
- package/dist/esm/lib/set-password-dialog.js +1 -1
- package/dist/esm/lib/set-password-dialog.js.map +1 -1
- package/dist/esm/lib/status.js.map +1 -1
- package/dist/esm/lib/users-search.js +1 -1
- package/dist/esm/lib/users-search.js.map +1 -1
- package/dist/esm/organization-switcher.client.js.map +1 -1
- package/package.json +33 -23
- package/dist/cjs/lib/use-layout-effect.cjs +0 -31
- package/dist/cjs/lib/use-layout-effect.cjs.map +0 -1
- package/dist/cjs/lib/use-layout-effect.d.cts +0 -5
- package/dist/esm/lib/use-layout-effect.d.ts +0 -5
- package/dist/esm/lib/use-layout-effect.js +0 -7
- package/dist/esm/lib/use-layout-effect.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/experimental/api/swr.ts"],"sourcesContent":["/**\n * Generated by orval v7.21.0 🍺\n * Do not edit manually.\n * WorkOS Widgets\n * WorkOS Widgets API\n * OpenAPI spec version: 1.0\n */\nimport useSwr from \"swr\";\nimport type { Arguments, Key, SWRConfiguration } from \"swr\";\n\nimport useSWRMutation from \"swr/mutation\";\nimport type { SWRMutationConfiguration } from \"swr/mutation\";\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const MemberStatus = {\n Active: \"Active\",\n Invited: \"Invited\",\n InviteExpired: \"InviteExpired\",\n InviteRevoked: \"InviteRevoked\",\n NoInvite: \"NoInvite\",\n} as const;\nexport type MemberStatus = (typeof MemberStatus)[keyof typeof MemberStatus];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const MemberActionsItem = {\n \"edit-role\": \"edit-role\",\n \"resend-invite\": \"resend-invite\",\n \"revoke-invite\": \"revoke-invite\",\n \"revoke-membership\": \"revoke-membership\",\n} as const;\nexport type MemberActions =\n (typeof MemberActionsItem)[keyof typeof MemberActionsItem][];\n\nexport type MemberRolesItem = {\n name: string;\n slug: string;\n /** @nullable */\n description?: string | null;\n};\n\nexport interface Member {\n id: string;\n email: string;\n emailVerified: boolean;\n /** @nullable */\n profilePictureUrl?: string | null;\n /** @nullable */\n firstName?: string | null;\n /** @nullable */\n lastName?: string | null;\n createdAt: string;\n /** @nullable */\n lastActivityAt?: string | null;\n status: MemberStatus;\n actions: MemberActions;\n /** @nullable */\n isLoggedInUser?: boolean | null;\n /** @nullable */\n roles?: MemberRolesItem[] | null;\n}\n\nexport interface ListMetadata {\n /** @nullable */\n before?: string | null;\n /** @nullable */\n after?: string | null;\n}\n\nexport interface MemberRole {\n name: string;\n slug: string;\n default: boolean;\n /** @nullable */\n description?: string | null;\n}\n\nexport interface RolesAndConfigResponse {\n roles: MemberRole[];\n multipleRolesEnabled: boolean;\n}\n\nexport interface OrganizationInfo {\n id: string;\n name: string;\n current: boolean;\n /** @nullable */\n favicon?: string | null;\n}\n\nexport interface OrganizationsResponse {\n data: OrganizationInfo[];\n}\n\nexport interface OAuthProfile {\n id: string;\n /** @nullable */\n email?: string | null;\n /** @nullable */\n firstName?: string | null;\n /** @nullable */\n lastName?: string | null;\n /** @nullable */\n profilePictureUrl?: string | null;\n /** @nullable */\n lastLoginAt?: string | null;\n}\n\n/**\n * @nullable\n */\nexport type MeOauthProfiles = {\n AppleOAuth?: OAuthProfile;\n GithubOAuth?: OAuthProfile;\n GoogleOAuth?: OAuthProfile;\n MicrosoftOAuth?: OAuthProfile;\n} | null;\n\nexport interface Me {\n id: string;\n email: string;\n /** @nullable */\n firstName?: string | null;\n /** @nullable */\n lastName?: string | null;\n /** @nullable */\n locale?: string | null;\n /** @nullable */\n profilePictureUrl?: string | null;\n /** @nullable */\n oauthProfiles?: MeOauthProfiles;\n}\n\nexport type CreateTotpFactorResponseAuthenticationFactorAllOfObject =\n (typeof CreateTotpFactorResponseAuthenticationFactorAllOfObject)[keyof typeof CreateTotpFactorResponseAuthenticationFactorAllOfObject];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const CreateTotpFactorResponseAuthenticationFactorAllOfObject = {\n authentication_factor: \"authentication_factor\",\n} as const;\n\nexport type CreateTotpFactorResponseAuthenticationFactorAllOfType =\n (typeof CreateTotpFactorResponseAuthenticationFactorAllOfType)[keyof typeof CreateTotpFactorResponseAuthenticationFactorAllOfType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const CreateTotpFactorResponseAuthenticationFactorAllOfType = {\n generic_otp: \"generic_otp\",\n sms: \"sms\",\n totp: \"totp\",\n webauthn: \"webauthn\",\n} as const;\n\n/**\n * @nullable\n */\nexport type CreateTotpFactorResponseAuthenticationFactorAllOfSms = {\n phone_number: string;\n} | null;\n\n/**\n * @nullable\n */\nexport type CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOf = {\n issuer: string;\n user: string;\n secret: string;\n qr_code: string;\n uri: string;\n} | null;\n\n/**\n * @nullable\n */\nexport type CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOfTwo = {\n issuer: string;\n user: string;\n} | null;\n\nexport type CreateTotpFactorResponseAuthenticationFactorAllOfTotp =\n | CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOf\n | CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOfTwo;\n\nexport type CreateTotpFactorResponseAuthenticationFactorAllOf = {\n object: CreateTotpFactorResponseAuthenticationFactorAllOfObject;\n id: string;\n type: CreateTotpFactorResponseAuthenticationFactorAllOfType;\n /** @nullable */\n user_id?: string | null;\n /** @nullable */\n sms?: CreateTotpFactorResponseAuthenticationFactorAllOfSms;\n totp?: CreateTotpFactorResponseAuthenticationFactorAllOfTotp;\n};\n\nexport type CreateTotpFactorResponseAuthenticationFactorAllOfEight = {\n created_at: string;\n updated_at: string;\n};\n\nexport type CreateTotpFactorResponseAuthenticationFactor =\n CreateTotpFactorResponseAuthenticationFactorAllOf &\n CreateTotpFactorResponseAuthenticationFactorAllOfEight;\n\nexport type CreateTotpFactorResponseAuthenticationChallengeAllOfObject =\n (typeof CreateTotpFactorResponseAuthenticationChallengeAllOfObject)[keyof typeof CreateTotpFactorResponseAuthenticationChallengeAllOfObject];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const CreateTotpFactorResponseAuthenticationChallengeAllOfObject = {\n authentication_challenge: \"authentication_challenge\",\n} as const;\n\nexport type CreateTotpFactorResponseAuthenticationChallengeAllOf = {\n object: CreateTotpFactorResponseAuthenticationChallengeAllOfObject;\n id: string;\n /** @nullable */\n expires_at?: string | null;\n /** @nullable */\n code?: string | null;\n authentication_factor_id: string;\n};\n\nexport type CreateTotpFactorResponseAuthenticationChallengeAllOfThree = {\n created_at: string;\n updated_at: string;\n};\n\nexport type CreateTotpFactorResponseAuthenticationChallenge =\n CreateTotpFactorResponseAuthenticationChallengeAllOf &\n CreateTotpFactorResponseAuthenticationChallengeAllOfThree;\n\nexport interface CreateTotpFactorResponse {\n authenticationFactor: CreateTotpFactorResponseAuthenticationFactor;\n authenticationChallenge: CreateTotpFactorResponseAuthenticationChallenge;\n}\n\nexport interface VerifyTotpFactorRequest {\n code: string;\n authenticationChallengeId: string;\n}\n\nexport type AuthenticationInformationResponseDataVerificationMethodsMfaProvider =\n (typeof AuthenticationInformationResponseDataVerificationMethodsMfaProvider)[keyof typeof AuthenticationInformationResponseDataVerificationMethodsMfaProvider];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AuthenticationInformationResponseDataVerificationMethodsMfaProvider =\n {\n MFA: \"MFA\",\n } as const;\n\n/**\n * @nullable\n */\nexport type AuthenticationInformationResponseDataVerificationMethodsMfa = {\n provider: AuthenticationInformationResponseDataVerificationMethodsMfaProvider;\n isSetUp: boolean;\n /** @nullable */\n lastUsed?: string | null;\n} | null;\n\nexport type AuthenticationInformationResponseDataVerificationMethodsPasswordProvider =\n (typeof AuthenticationInformationResponseDataVerificationMethodsPasswordProvider)[keyof typeof AuthenticationInformationResponseDataVerificationMethodsPasswordProvider];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AuthenticationInformationResponseDataVerificationMethodsPasswordProvider =\n {\n Password: \"Password\",\n } as const;\n\n/**\n * @nullable\n */\nexport type AuthenticationInformationResponseDataVerificationMethodsPassword = {\n provider: AuthenticationInformationResponseDataVerificationMethodsPasswordProvider;\n isSetUp: boolean;\n /** @nullable */\n lastUsed?: string | null;\n isCurrentSession: boolean;\n} | null;\n\nexport type AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider =\n (typeof AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider)[keyof typeof AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider =\n {\n Passkey: \"Passkey\",\n } as const;\n\nexport type AuthenticationInformationResponseDataVerificationMethodsPasskeyPassKeysItem =\n {\n id: string;\n };\n\n/**\n * @nullable\n */\nexport type AuthenticationInformationResponseDataVerificationMethodsPasskey = {\n provider: AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider;\n isSetUp: boolean;\n /** @nullable */\n lastUsed?: string | null;\n passKeys: AuthenticationInformationResponseDataVerificationMethodsPasskeyPassKeysItem[];\n isCurrentSession: boolean;\n} | null;\n\nexport type AuthenticationInformationResponseDataVerificationMethods = {\n /** @nullable */\n Mfa?: AuthenticationInformationResponseDataVerificationMethodsMfa;\n /** @nullable */\n Password?: AuthenticationInformationResponseDataVerificationMethodsPassword;\n /** @nullable */\n Passkey?: AuthenticationInformationResponseDataVerificationMethodsPasskey;\n};\n\nexport type AuthenticationInformationResponseDataPasswordSettings = {\n isPasswordNumberRequired: boolean;\n isPasswordPwnedRequired: boolean;\n isPasswordSymbolRequired: boolean;\n isPasswordUppercaseRequired: boolean;\n passwordMinimumLength: number;\n passwordMinimumStrength: number;\n};\n\nexport type AuthenticationInformationResponseData = {\n verificationMethods: AuthenticationInformationResponseDataVerificationMethods;\n passwordSettings: AuthenticationInformationResponseDataPasswordSettings;\n};\n\nexport interface AuthenticationInformationResponse {\n data: AuthenticationInformationResponseData;\n}\n\nexport interface CreatePasswordRequest {\n password: string;\n}\n\nexport interface UpdatePasswordRequest {\n newPassword: string;\n currentPassword: string;\n}\n\nexport interface RevokeAllSessionsRequest {\n currentSessionId: string;\n}\n\nexport type ActiveSessionState = {\n tag: string;\n /** @nullable */\n expiresAt?: string | null;\n};\n\n/**\n * @nullable\n */\nexport type ActiveSessionCurrentLocation = {\n cityName: string;\n countryISOCode: string;\n} | null;\n\nexport interface ActiveSession {\n id: string;\n userlandUserId: string;\n /** @nullable */\n ipAddress?: string | null;\n /** @nullable */\n userAgent?: string | null;\n /** @nullable */\n organizationId?: string | null;\n state: ActiveSessionState;\n /** @nullable */\n currentLocation?: ActiveSessionCurrentLocation;\n usedSsoAuth: boolean;\n usedPasswordAuth: boolean;\n usedPasskeyAuth: boolean;\n usedAppleOauth: boolean;\n usedBitbucketOauth: boolean;\n usedGithubOauth: boolean;\n usedGitLabOauth: boolean;\n usedGoogleOauth: boolean;\n usedLinkedInOauth: boolean;\n usedImpersonation: boolean;\n usedMicrosoftOauth: boolean;\n usedSlackOauth: boolean;\n usedXeroOauth: boolean;\n usedMagicAuth: boolean;\n /** @nullable */\n impersonatorUserId?: string | null;\n /** @nullable */\n impersonatorEmail?: string | null;\n /** @nullable */\n impersonationReason?: string | null;\n /** @nullable */\n lastActivityAt?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ActiveSessionsResponse {\n data: ActiveSession[];\n}\n\nexport type SendVerificationResponseType =\n (typeof SendVerificationResponseType)[keyof typeof SendVerificationResponseType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SendVerificationResponseType = {\n EmailVerification: \"EmailVerification\",\n} as const;\n\nexport interface SendVerificationResponse {\n authenticationChallenge: string;\n type: SendVerificationResponseType;\n}\n\nexport interface VerifyRequest {\n code: string;\n authenticationChallengeId: string;\n}\n\nexport interface VerifyResponse {\n elevatedAccessToken: string;\n expiresAt: string;\n}\n\nexport type RegisterPasskeyResponseOptions = { [key: string]: unknown };\n\nexport interface RegisterPasskeyResponse {\n challengeId: string;\n options: RegisterPasskeyResponseOptions;\n}\n\nexport type VerifyPasskeyRequestResponse = { [key: string]: unknown };\n\nexport interface VerifyPasskeyRequest {\n challengeId: string;\n response: VerifyPasskeyRequestResponse;\n}\n\nexport type SettingsResponseObject =\n (typeof SettingsResponseObject)[keyof typeof SettingsResponseObject];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SettingsResponseObject = {\n settings: \"settings\",\n} as const;\n\nexport interface SettingsResponse {\n object: SettingsResponseObject;\n authkitOrigin: string;\n /** @nullable */\n logoDarkIconPath?: string | null;\n /** @nullable */\n logoDarkPath?: string | null;\n /** @nullable */\n logoLightIconPath?: string | null;\n /** @nullable */\n logoLightPath?: string | null;\n teamName: string;\n}\n\nexport type OrganizationDomainState =\n (typeof OrganizationDomainState)[keyof typeof OrganizationDomainState];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const OrganizationDomainState = {\n Failed: \"Failed\",\n LegacyVerified: \"LegacyVerified\",\n Pending: \"Pending\",\n Verified: \"Verified\",\n} as const;\n\nexport type DomainVerificationNameServer =\n (typeof DomainVerificationNameServer)[keyof typeof DomainVerificationNameServer];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const DomainVerificationNameServer = {\n AwsRoute53: \"AwsRoute53\",\n GoogleDomains: \"GoogleDomains\",\n CloudFlare: \"CloudFlare\",\n GoDaddy: \"GoDaddy\",\n Other: \"Other\",\n} as const;\n\nexport interface OrganizationDomain {\n id: string;\n domain: string;\n state: OrganizationDomainState;\n nameServer: DomainVerificationNameServer;\n /** @nullable */\n verificationPrefix?: string | null;\n /** @nullable */\n verificationToken?: string | null;\n /** @nullable */\n subdomain?: string | null;\n createdAt: string;\n}\n\nexport interface X509CertificateJSON {\n id: string;\n value: string;\n /** @nullable */\n notBefore?: string | null;\n /** @nullable */\n notAfter?: string | null;\n /** @nullable */\n lastExpiryEventSentAt?: string | null;\n}\n\nexport type SamlSessionState =\n (typeof SamlSessionState)[keyof typeof SamlSessionState];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SamlSessionState = {\n Authorized: \"Authorized\",\n Failed: \"Failed\",\n Started: \"Started\",\n Successful: \"Successful\",\n Timedout: \"Timedout\",\n} as const;\n\nexport type OidcSessionState =\n (typeof OidcSessionState)[keyof typeof OidcSessionState];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const OidcSessionState = {\n Started: \"Started\",\n Authorized: \"Authorized\",\n Successful: \"Successful\",\n Failed: \"Failed\",\n Terminated: \"Terminated\",\n Timedout: \"Timedout\",\n} as const;\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SsoConnectionSessionJSONState = {\n ...SamlSessionState,\n ...OidcSessionState,\n} as const;\nexport interface SsoConnectionSessionJSON {\n id: string;\n createdAt: string;\n state: (typeof SsoConnectionSessionJSONState)[keyof typeof SsoConnectionSessionJSONState];\n}\n\nexport type SsoConnectionAnyOfType =\n (typeof SsoConnectionAnyOfType)[keyof typeof SsoConnectionAnyOfType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SsoConnectionAnyOfType = {\n AdfsSaml: \"AdfsSaml\",\n Auth0Saml: \"Auth0Saml\",\n AzureSaml: \"AzureSaml\",\n CasSaml: \"CasSaml\",\n ClassLinkSaml: \"ClassLinkSaml\",\n CloudflareSaml: \"CloudflareSaml\",\n CyberArkSaml: \"CyberArkSaml\",\n DuoSaml: \"DuoSaml\",\n GenericSaml: \"GenericSaml\",\n GoogleSaml: \"GoogleSaml\",\n JumpCloudSaml: \"JumpCloudSaml\",\n KeycloakSaml: \"KeycloakSaml\",\n LastPassSaml: \"LastPassSaml\",\n MiniOrangeSaml: \"MiniOrangeSaml\",\n NetIqSaml: \"NetIqSaml\",\n OktaSaml: \"OktaSaml\",\n OneLoginSaml: \"OneLoginSaml\",\n OracleSaml: \"OracleSaml\",\n PingFederateSaml: \"PingFederateSaml\",\n PingOneSaml: \"PingOneSaml\",\n RipplingSaml: \"RipplingSaml\",\n SalesforceSaml: \"SalesforceSaml\",\n ShibbolethGenericSaml: \"ShibbolethGenericSaml\",\n ShibbolethSaml: \"ShibbolethSaml\",\n SimpleSamlPhpSaml: \"SimpleSamlPhpSaml\",\n TestIdp: \"TestIdp\",\n VmWareSaml: \"VmWareSaml\",\n} as const;\n\nexport type SsoConnectionAnyOfState =\n (typeof SsoConnectionAnyOfState)[keyof typeof SsoConnectionAnyOfState];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SsoConnectionAnyOfState = {\n Inactive: \"Inactive\",\n Validating: \"Validating\",\n Active: \"Active\",\n Deleting: \"Deleting\",\n} as const;\n\nexport type SsoConnectionAnyOfLatestExpiringCertificate =\n X509CertificateJSON | null;\n\nexport type SsoConnectionAnyOfLatestExpiredCertificate =\n X509CertificateJSON | null;\n\nexport type SsoConnectionAnyOfProviderTag =\n (typeof SsoConnectionAnyOfProviderTag)[keyof typeof SsoConnectionAnyOfProviderTag];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SsoConnectionAnyOfProviderTag = {\n Saml: \"Saml\",\n} as const;\n\nexport type SsoConnectionAnyOfLastSession = SsoConnectionSessionJSON | null;\n\nexport type SsoConnectionAnyOf = {\n id: string;\n type: SsoConnectionAnyOfType;\n name: string;\n state: SsoConnectionAnyOfState;\n x509Certificates: X509CertificateJSON[];\n latestExpiringCertificate?: SsoConnectionAnyOfLatestExpiringCertificate;\n latestExpiredCertificate?: SsoConnectionAnyOfLatestExpiredCertificate;\n createdAt: string;\n providerTag: SsoConnectionAnyOfProviderTag;\n lastSession?: SsoConnectionAnyOfLastSession;\n};\n\nexport type SsoConnectionAnyOfEightAllOfState =\n (typeof SsoConnectionAnyOfEightAllOfState)[keyof typeof SsoConnectionAnyOfEightAllOfState];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SsoConnectionAnyOfEightAllOfState = {\n Inactive: \"Inactive\",\n Validating: \"Validating\",\n Active: \"Active\",\n Deleting: \"Deleting\",\n} as const;\n\nexport type SsoConnectionAnyOfEightAllOfType =\n (typeof SsoConnectionAnyOfEightAllOfType)[keyof typeof SsoConnectionAnyOfEightAllOfType];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SsoConnectionAnyOfEightAllOfType = {\n AdpOidc: \"AdpOidc\",\n Auth0Migration: \"Auth0Migration\",\n CleverOidc: \"CleverOidc\",\n EntraIdOidc: \"EntraIdOidc\",\n GenericOidc: \"GenericOidc\",\n GoogleOidc: \"GoogleOidc\",\n OktaOidc: \"OktaOidc\",\n LoginGovOidc: \"LoginGovOidc\",\n} as const;\n\nexport type SsoConnectionAnyOfEightAllOfProviderTag =\n (typeof SsoConnectionAnyOfEightAllOfProviderTag)[keyof typeof SsoConnectionAnyOfEightAllOfProviderTag];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const SsoConnectionAnyOfEightAllOfProviderTag = {\n OpenIdConnect: \"OpenIdConnect\",\n} as const;\n\nexport type SsoConnectionAnyOfEightAllOfLastSession =\n SsoConnectionSessionJSON | null;\n\nexport type SsoConnectionAnyOfEightAllOf = {\n id: string;\n name: string;\n state: SsoConnectionAnyOfEightAllOfState;\n type: SsoConnectionAnyOfEightAllOfType;\n createdAt: string;\n providerTag: SsoConnectionAnyOfEightAllOfProviderTag;\n lastSession?: SsoConnectionAnyOfEightAllOfLastSession;\n};\n\nexport type SsoConnectionAnyOfEightAllOfSix = {\n x509Certificates?: null;\n latestExpiringCertificate?: null;\n latestExpiredCertificate?: null;\n};\n\nexport type SsoConnectionAnyOfEight = SsoConnectionAnyOfEightAllOf &\n SsoConnectionAnyOfEightAllOfSix;\n\nexport type SsoConnection = SsoConnectionAnyOf | SsoConnectionAnyOfEight;\n\nexport interface ListOrganizationApiKeysResponseData {\n id: string;\n name: string;\n obfuscatedValue: string;\n createdAt: string;\n /** @nullable */\n lastUsedAt?: string | null;\n permissions: string[];\n}\n\nexport type ListOrganizationApiKeysResponseListMetadata = {\n before?: string;\n after?: string;\n};\n\nexport interface ListOrganizationApiKeysResponse {\n data: ListOrganizationApiKeysResponseData[];\n listMetadata: ListOrganizationApiKeysResponseListMetadata;\n}\n\nexport interface CreateOrganizationApiKeyRequest {\n name: string;\n permissions: string[];\n}\n\nexport interface CreateOrganizationApiKeyResponse {\n id: string;\n value: string;\n obfuscatedValue: string;\n createdAt: string;\n name: string;\n permissions: string[];\n}\n\nexport interface ListOrganizationApiKeyPermission {\n id: string;\n slug: string;\n name: string;\n /** @nullable */\n description?: string | null;\n}\n\nexport type ListOrganizationApiKeyPermissionsResponseListMetadata = {\n before?: string;\n after?: string;\n};\n\nexport interface ListOrganizationApiKeyPermissionsResponse {\n data: ListOrganizationApiKeyPermission[];\n listMetadata: ListOrganizationApiKeyPermissionsResponseListMetadata;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const DataInstallationObject = {\n data_installation: \"data_installation\",\n connected_account: \"connected_account\",\n} as const;\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const DataInstallationState = {\n connected: \"connected\",\n needs_reauthorization: \"needs_reauthorization\",\n} as const;\nexport interface DataInstallation {\n object: (typeof DataInstallationObject)[keyof typeof DataInstallationObject];\n id: string;\n /** @nullable */\n userlandUserId?: string | null;\n /** @nullable */\n organizationId?: string | null;\n scopes: string[];\n state: (typeof DataInstallationState)[keyof typeof DataInstallationState];\n createdAt: string;\n updatedAt: string;\n}\n\nexport type DataIntegrationObject =\n (typeof DataIntegrationObject)[keyof typeof DataIntegrationObject];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const DataIntegrationObject = {\n data_integration: \"data_integration\",\n} as const;\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const DataIntegrationIntegrationType = {\n asana: \"asana\",\n box: \"box\",\n \"cal-dot-com\": \"cal-dot-com\",\n calendly: \"calendly\",\n confluence: \"confluence\",\n dropbox: \"dropbox\",\n \"frame-io\": \"frame-io\",\n front: \"front\",\n github: \"github\",\n gitlab: \"gitlab\",\n gmail: \"gmail\",\n google: \"google\",\n \"google-calendar\": \"google-calendar\",\n \"google-drive\": \"google-drive\",\n helpscout: \"helpscout\",\n hubspot: \"hubspot\",\n intercom: \"intercom\",\n jira: \"jira\",\n linear: \"linear\",\n microsoft: \"microsoft\",\n \"microsoft-onedrive\": \"microsoft-onedrive\",\n \"microsoft-onenote\": \"microsoft-onenote\",\n \"microsoft-outlook\": \"microsoft-outlook\",\n \"microsoft-outlook-calendar\": \"microsoft-outlook-calendar\",\n \"microsoft-sharepoint\": \"microsoft-sharepoint\",\n \"microsoft-teams\": \"microsoft-teams\",\n \"microsoft-todo\": \"microsoft-todo\",\n notion: \"notion\",\n prefect: \"prefect\",\n \"pydantic-logfire\": \"pydantic-logfire\",\n salesforce: \"salesforce\",\n sentry: \"sentry\",\n slack: \"slack\",\n snowflake: \"snowflake\",\n stripe: \"stripe\",\n xero: \"xero\",\n zendesk: \"zendesk\",\n} as const;\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const DataIntegrationOwnership = {\n userland_user: \"userland_user\",\n organization: \"organization\",\n} as const;\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const DataIntegrationCredentialsType = {\n shared: \"shared\",\n custom: \"custom\",\n} as const;\nexport type DataIntegrationInstallation = DataInstallation | null;\n\nexport interface DataIntegration {\n object: DataIntegrationObject;\n id: string;\n name: string;\n /** @nullable */\n description?: string | null;\n slug: string;\n integrationType: (typeof DataIntegrationIntegrationType)[keyof typeof DataIntegrationIntegrationType];\n ownership: (typeof DataIntegrationOwnership)[keyof typeof DataIntegrationOwnership];\n credentialsType: (typeof DataIntegrationCredentialsType)[keyof typeof DataIntegrationCredentialsType];\n /** @nullable */\n scopes?: string[] | null;\n createdAt: string;\n updatedAt: string;\n installation?: DataIntegrationInstallation;\n}\n\nexport interface DataIntegrationsResponse {\n data: DataIntegration[];\n}\n\nexport type GetDataIntegrationAuthorizeUrlResponseAllOf = {\n url: string;\n redirectToken: string;\n};\n\nexport type GetDataIntegrationAuthorizeUrlResponseAllOfTwo = {\n handoffToken?: string;\n};\n\nexport type GetDataIntegrationAuthorizeUrlResponse =\n GetDataIntegrationAuthorizeUrlResponseAllOf &\n GetDataIntegrationAuthorizeUrlResponseAllOfTwo;\n\nexport interface GetAuthorizationStatusResponse {\n isConnecting: boolean;\n}\n\nexport type MembersParams = {\n search?: string;\n limit?: string;\n before?: string;\n after?: string;\n role?: string;\n};\n\nexport type Members200 = {\n data: Member[];\n listMetadata: ListMetadata;\n};\n\nexport type Members403 = {\n message: string;\n};\n\nexport type Members404 = {\n message: string;\n};\n\nexport type Roles403 = {\n message: string;\n};\n\nexport type Roles404 = {\n message: string;\n};\n\nexport type RolesAndConfig403 = {\n message: string;\n};\n\nexport type RolesAndConfig404 = {\n message: string;\n};\n\nexport type InviteMemberBody = {\n email: string;\n /** @nullable */\n firstName?: string | null;\n /** @nullable */\n lastName?: string | null;\n roles: string[];\n};\n\nexport type InviteMember201 = {\n success: boolean;\n};\n\nexport type InviteMember400 = {\n message: string;\n};\n\nexport type InviteMember403 = {\n message: string;\n};\n\nexport type InviteMember404 = {\n message: string;\n};\n\nexport type ResendInvite201 = {\n /** @nullable */\n id?: string | null;\n success: boolean;\n};\n\nexport type ResendInvite400 = {\n message: string;\n};\n\nexport type ResendInvite403 = {\n message: string;\n};\n\nexport type ResendInvite404 = {\n message: string;\n};\n\nexport type ResendInvite422 = {\n message: string;\n};\n\nexport type RevokeInvite200 = {\n id: string;\n success: boolean;\n};\n\nexport type RevokeInvite400 = {\n message: string;\n};\n\nexport type RevokeInvite403 = {\n message: string;\n};\n\nexport type RevokeInvite404 = {\n message: string;\n};\n\nexport type RemoveMember200 = {\n id: string;\n success: boolean;\n};\n\nexport type RemoveMember400 = {\n message: string;\n};\n\nexport type RemoveMember403 = {\n message: string;\n};\n\nexport type RemoveMember404 = {\n message: string;\n};\n\nexport type UpdateMemberBody = {\n roles: string[];\n};\n\nexport type UpdateMember200 = {\n id: string;\n success: boolean;\n};\n\nexport type UpdateMember400 = {\n message: string;\n};\n\nexport type UpdateMember403 = {\n message: string;\n};\n\nexport type UpdateMember404 = {\n message: string;\n};\n\nexport type UpdateMember422 = {\n message: string;\n};\n\nexport type Organizations403 = {\n message: string;\n};\n\nexport type Organizations404 = {\n message: string;\n};\n\nexport type Me403 = {\n message: string;\n};\n\nexport type UpdateMeBody = {\n firstName?: string;\n lastName?: string;\n locale?: string;\n};\n\nexport type UpdateMe400 = {\n message: string;\n};\n\nexport type UpdateMe403 = {\n message: string;\n};\n\nexport type CreateTotpFactor400 = {\n message: string;\n};\n\nexport type CreateTotpFactor403 = {\n message: string;\n};\n\nexport type VerifyTotpFactor200 = {\n success: boolean;\n};\n\nexport type VerifyTotpFactor400 = {\n message: string;\n};\n\nexport type VerifyTotpFactor403 = {\n message: string;\n};\n\nexport type DeleteTotpFactors200 = {\n success: boolean;\n};\n\nexport type DeleteTotpFactors400 = {\n message: string;\n};\n\nexport type DeleteTotpFactors403 = {\n message: string;\n};\n\nexport type AuthenticationInformation403 = {\n message: string;\n};\n\nexport type CreatePassword201 = {\n success: boolean;\n};\n\nexport type CreatePassword400 = {\n message: string;\n};\n\nexport type CreatePassword403 = {\n message: string;\n};\n\nexport type UpdatePassword201 = {\n success: boolean;\n};\n\nexport type UpdatePassword400 = {\n message: string;\n};\n\nexport type UpdatePassword403 = {\n message: string;\n};\n\nexport type RevokeAllSessions200 = {\n success: boolean;\n};\n\nexport type RevokeAllSessions400 = {\n message: string;\n};\n\nexport type RevokeAllSessions403 = {\n message: string;\n};\n\nexport type RevokeSession200 = {\n success: boolean;\n};\n\nexport type RevokeSession400 = {\n message: string;\n};\n\nexport type RevokeSession403 = {\n message: string;\n};\n\nexport type Sessions403 = {\n message: string;\n};\n\nexport type SendVerification400 = {\n message: string;\n};\n\nexport type SendVerification403 = {\n message: string;\n};\n\nexport type Verify400 = {\n message: string;\n};\n\nexport type Verify403 = {\n message: string;\n};\n\nexport type RegisterPasskey400 = {\n message: string;\n};\n\nexport type RegisterPasskey403 = {\n message: string;\n};\n\nexport type VerifyPasskey200 = {\n success: boolean;\n};\n\nexport type VerifyPasskey400 = {\n message: string;\n};\n\nexport type VerifyPasskey403 = {\n message: string;\n};\n\nexport type DeletePasskey200 = {\n success: boolean;\n};\n\nexport type DeletePasskey400 = {\n message: string;\n};\n\nexport type DeletePasskey403 = {\n message: string;\n};\n\nexport type Settings403 = {\n message: string;\n};\n\nexport type ListOrganizationDomains200 = {\n data: OrganizationDomain[];\n};\n\nexport type ListOrganizationDomains403 = {\n message: string;\n};\n\nexport type ListOrganizationDomains404 = {\n message: string;\n};\n\nexport type GenerateAdminPortalLinkParams = {\n intent: GenerateAdminPortalLinkIntent;\n};\n\nexport type GenerateAdminPortalLinkIntent =\n (typeof GenerateAdminPortalLinkIntent)[keyof typeof GenerateAdminPortalLinkIntent];\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const GenerateAdminPortalLinkIntent = {\n domain_verification: \"domain_verification\",\n sso: \"sso\",\n} as const;\n\nexport type GenerateAdminPortalLink201 = {\n link: string;\n};\n\nexport type GenerateAdminPortalLink403 = {\n message: string;\n};\n\nexport type GenerateAdminPortalLink404 = {\n message: string;\n};\n\nexport type GenerateAdminPortalLink500 = {\n message: string;\n};\n\nexport type DeleteOrganizationDomain403 = {\n message: string;\n};\n\nexport type DeleteOrganizationDomain404 = {\n message: string;\n};\n\nexport type ReverifyOrganizationDomain403 = {\n message: string;\n};\n\nexport type ReverifyOrganizationDomain404 = {\n message: string;\n};\n\nexport type CreateOrganizationApiKey400 = {\n message: string;\n};\n\nexport type CreateOrganizationApiKey403 = {\n message: string;\n};\n\nexport type CreateOrganizationApiKey404 = {\n message: string;\n};\n\nexport type CreateOrganizationApiKey422ErrorsItem = {\n code: string;\n field: string;\n};\n\nexport type CreateOrganizationApiKey422 = {\n message: string;\n errors: CreateOrganizationApiKey422ErrorsItem[];\n};\n\nexport type ListOrganizationApiKeysParams = {\n limit?: number;\n before?: string;\n after?: string;\n search?: string;\n};\n\nexport type ListOrganizationApiKeys400 = {\n message: string;\n};\n\nexport type ListOrganizationApiKeys403 = {\n message: string;\n};\n\nexport type ListOrganizationApiKeyPermissionsParams = {\n search?: string;\n limit?: number;\n before?: string;\n after?: string;\n};\n\nexport type ListOrganizationApiKeyPermissions400 = {\n message: string;\n};\n\nexport type ListOrganizationApiKeyPermissions403 = {\n message: string;\n};\n\nexport type DeleteOrganizationApiKey200 = {\n success: boolean;\n};\n\nexport type DeleteOrganizationApiKey403 = {\n message: string;\n};\n\nexport type DeleteOrganizationApiKey404 = {\n message: string;\n};\n\nexport type MyDataIntegrations403 = {\n message: string;\n};\n\nexport type GetDataIntegrationAuthorizeUrlParams = {\n requireHandoff?: boolean;\n};\n\nexport type GetDataIntegrationAuthorizeUrl400 = {\n message: string;\n};\n\nexport type GetDataIntegrationAuthorizeUrl403 = {\n message: string;\n};\n\nexport type GetDataIntegrationAuthorizeUrl404 = {\n message: string;\n};\n\nexport type GetDataInstallationAuthorizationStatus400 = {\n message: string;\n};\n\nexport type GetDataInstallationAuthorizationStatus403 = {\n message: string;\n};\n\nexport type GetDataInstallationAuthorizationStatus404 = {\n message: string;\n};\n\nexport type DeleteDataInstallation200 = {\n success: boolean;\n};\n\nexport type DeleteDataInstallation403 = {\n message: string;\n};\n\nexport type DeleteDataInstallation404 = {\n message: string;\n};\n\nexport type membersResponse200 = {\n data: Members200;\n status: 200;\n};\n\nexport type membersResponse403 = {\n data: Members403;\n status: 403;\n};\n\nexport type membersResponse404 = {\n data: Members404;\n status: 404;\n};\n\nexport type membersResponseSuccess = membersResponse200 & {\n headers: Headers;\n};\nexport type membersResponseError = (membersResponse403 | membersResponse404) & {\n headers: Headers;\n};\n\nexport type membersResponse = membersResponseSuccess | membersResponseError;\n\nexport const getMembersUrl = (params?: MembersParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : value.toString());\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `https://api.workos.com/_widgets/UserManagement/members?${stringifiedParams}`\n : `https://api.workos.com/_widgets/UserManagement/members`;\n};\n\nexport const members = async (\n params?: MembersParams,\n options?: RequestInit,\n): Promise<membersResponse> => {\n const res = await fetch(getMembersUrl(params), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: membersResponse[\"data\"] = body ? JSON.parse(body) : {};\n return { data, status: res.status, headers: res.headers } as membersResponse;\n};\n\nexport const getMembersKey = (params?: MembersParams) =>\n [\n `https://api.workos.com/_widgets/UserManagement/members`,\n ...(params ? [params] : []),\n ] as const;\n\nexport type MembersQueryResult = NonNullable<\n Awaited<ReturnType<typeof members>>\n>;\nexport type MembersQueryError = Promise<Members403 | Members404>;\n\nexport const useMembers = <TError = Promise<Members403 | Members404>>(\n params?: MembersParams,\n options?: {\n swr?: SWRConfiguration<Awaited<ReturnType<typeof members>>, TError> & {\n swrKey?: Key;\n enabled?: boolean;\n };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey =\n swrOptions?.swrKey ?? (() => (isEnabled ? getMembersKey(params) : null));\n const swrFn = () => members(params, fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type rolesResponse200 = {\n data: MemberRole[];\n status: 200;\n};\n\nexport type rolesResponse403 = {\n data: Roles403;\n status: 403;\n};\n\nexport type rolesResponse404 = {\n data: Roles404;\n status: 404;\n};\n\nexport type rolesResponseSuccess = rolesResponse200 & {\n headers: Headers;\n};\nexport type rolesResponseError = (rolesResponse403 | rolesResponse404) & {\n headers: Headers;\n};\n\nexport type rolesResponse = rolesResponseSuccess | rolesResponseError;\n\nexport const getRolesUrl = () => {\n return `https://api.workos.com/_widgets/UserManagement/roles`;\n};\n\nexport const roles = async (options?: RequestInit): Promise<rolesResponse> => {\n const res = await fetch(getRolesUrl(), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: rolesResponse[\"data\"] = body ? JSON.parse(body) : {};\n return { data, status: res.status, headers: res.headers } as rolesResponse;\n};\n\nexport const getRolesKey = () =>\n [`https://api.workos.com/_widgets/UserManagement/roles`] as const;\n\nexport type RolesQueryResult = NonNullable<Awaited<ReturnType<typeof roles>>>;\nexport type RolesQueryError = Promise<Roles403 | Roles404>;\n\nexport const useRoles = <TError = Promise<Roles403 | Roles404>>(options?: {\n swr?: SWRConfiguration<Awaited<ReturnType<typeof roles>>, TError> & {\n swrKey?: Key;\n enabled?: boolean;\n };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey =\n swrOptions?.swrKey ?? (() => (isEnabled ? getRolesKey() : null));\n const swrFn = () => roles(fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type rolesAndConfigResponse200 = {\n data: RolesAndConfigResponse;\n status: 200;\n};\n\nexport type rolesAndConfigResponse403 = {\n data: RolesAndConfig403;\n status: 403;\n};\n\nexport type rolesAndConfigResponse404 = {\n data: RolesAndConfig404;\n status: 404;\n};\n\nexport type rolesAndConfigResponseSuccess = rolesAndConfigResponse200 & {\n headers: Headers;\n};\nexport type rolesAndConfigResponseError = (\n | rolesAndConfigResponse403\n | rolesAndConfigResponse404\n) & {\n headers: Headers;\n};\n\nexport type rolesAndConfigResponse =\n | rolesAndConfigResponseSuccess\n | rolesAndConfigResponseError;\n\nexport const getRolesAndConfigUrl = () => {\n return `https://api.workos.com/_widgets/UserManagement/roles-and-config`;\n};\n\nexport const rolesAndConfig = async (\n options?: RequestInit,\n): Promise<rolesAndConfigResponse> => {\n const res = await fetch(getRolesAndConfigUrl(), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: rolesAndConfigResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as rolesAndConfigResponse;\n};\n\nexport const getRolesAndConfigKey = () =>\n [`https://api.workos.com/_widgets/UserManagement/roles-and-config`] as const;\n\nexport type RolesAndConfigQueryResult = NonNullable<\n Awaited<ReturnType<typeof rolesAndConfig>>\n>;\nexport type RolesAndConfigQueryError = Promise<\n RolesAndConfig403 | RolesAndConfig404\n>;\n\nexport const useRolesAndConfig = <\n TError = Promise<RolesAndConfig403 | RolesAndConfig404>,\n>(options?: {\n swr?: SWRConfiguration<Awaited<ReturnType<typeof rolesAndConfig>>, TError> & {\n swrKey?: Key;\n enabled?: boolean;\n };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey =\n swrOptions?.swrKey ?? (() => (isEnabled ? getRolesAndConfigKey() : null));\n const swrFn = () => rolesAndConfig(fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type inviteMemberResponse201 = {\n data: InviteMember201;\n status: 201;\n};\n\nexport type inviteMemberResponse400 = {\n data: InviteMember400;\n status: 400;\n};\n\nexport type inviteMemberResponse403 = {\n data: InviteMember403;\n status: 403;\n};\n\nexport type inviteMemberResponse404 = {\n data: InviteMember404;\n status: 404;\n};\n\nexport type inviteMemberResponseSuccess = inviteMemberResponse201 & {\n headers: Headers;\n};\nexport type inviteMemberResponseError = (\n | inviteMemberResponse400\n | inviteMemberResponse403\n | inviteMemberResponse404\n) & {\n headers: Headers;\n};\n\nexport type inviteMemberResponse =\n | inviteMemberResponseSuccess\n | inviteMemberResponseError;\n\nexport const getInviteMemberUrl = () => {\n return `https://api.workos.com/_widgets/UserManagement/invite-user`;\n};\n\nexport const inviteMember = async (\n inviteMemberBody: InviteMemberBody,\n options?: RequestInit,\n): Promise<inviteMemberResponse> => {\n const res = await fetch(getInviteMemberUrl(), {\n ...options,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", ...options?.headers },\n body: JSON.stringify(inviteMemberBody),\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: inviteMemberResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as inviteMemberResponse;\n};\n\nexport const getInviteMemberMutationFetcher = (options?: RequestInit) => {\n return (_: Key, { arg }: { arg: InviteMemberBody }) => {\n return inviteMember(arg, options);\n };\n};\nexport const getInviteMemberMutationKey = () =>\n [`https://api.workos.com/_widgets/UserManagement/invite-user`] as const;\n\nexport type InviteMemberMutationResult = NonNullable<\n Awaited<ReturnType<typeof inviteMember>>\n>;\nexport type InviteMemberMutationError = Promise<\n InviteMember400 | InviteMember403 | InviteMember404\n>;\n\nexport const useInviteMember = <\n TError = Promise<InviteMember400 | InviteMember403 | InviteMember404>,\n>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof inviteMember>>,\n TError,\n Key,\n InviteMemberBody,\n Awaited<ReturnType<typeof inviteMember>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getInviteMemberMutationKey();\n const swrFn = getInviteMemberMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type resendInviteResponse201 = {\n data: ResendInvite201;\n status: 201;\n};\n\nexport type resendInviteResponse400 = {\n data: ResendInvite400;\n status: 400;\n};\n\nexport type resendInviteResponse403 = {\n data: ResendInvite403;\n status: 403;\n};\n\nexport type resendInviteResponse404 = {\n data: ResendInvite404;\n status: 404;\n};\n\nexport type resendInviteResponse422 = {\n data: ResendInvite422;\n status: 422;\n};\n\nexport type resendInviteResponseSuccess = resendInviteResponse201 & {\n headers: Headers;\n};\nexport type resendInviteResponseError = (\n | resendInviteResponse400\n | resendInviteResponse403\n | resendInviteResponse404\n | resendInviteResponse422\n) & {\n headers: Headers;\n};\n\nexport type resendInviteResponse =\n | resendInviteResponseSuccess\n | resendInviteResponseError;\n\nexport const getResendInviteUrl = (userId: string) => {\n return `https://api.workos.com/_widgets/UserManagement/invites/${userId}/resend`;\n};\n\nexport const resendInvite = async (\n userId: string,\n options?: RequestInit,\n): Promise<resendInviteResponse> => {\n const res = await fetch(getResendInviteUrl(userId), {\n ...options,\n method: \"POST\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: resendInviteResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as resendInviteResponse;\n};\n\nexport const getResendInviteMutationFetcher = (\n userId: string,\n options?: RequestInit,\n) => {\n return (_: Key, __: { arg: Arguments }) => {\n return resendInvite(userId, options);\n };\n};\nexport const getResendInviteMutationKey = (userId: string) =>\n [\n `https://api.workos.com/_widgets/UserManagement/invites/${userId}/resend`,\n ] as const;\n\nexport type ResendInviteMutationResult = NonNullable<\n Awaited<ReturnType<typeof resendInvite>>\n>;\nexport type ResendInviteMutationError = Promise<\n ResendInvite400 | ResendInvite403 | ResendInvite404 | ResendInvite422\n>;\n\nexport const useResendInvite = <\n TError = Promise<\n ResendInvite400 | ResendInvite403 | ResendInvite404 | ResendInvite422\n >,\n>(\n userId: string,\n options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof resendInvite>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof resendInvite>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getResendInviteMutationKey(userId);\n const swrFn = getResendInviteMutationFetcher(userId, fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type revokeInviteResponse200 = {\n data: RevokeInvite200;\n status: 200;\n};\n\nexport type revokeInviteResponse400 = {\n data: RevokeInvite400;\n status: 400;\n};\n\nexport type revokeInviteResponse403 = {\n data: RevokeInvite403;\n status: 403;\n};\n\nexport type revokeInviteResponse404 = {\n data: RevokeInvite404;\n status: 404;\n};\n\nexport type revokeInviteResponseSuccess = revokeInviteResponse200 & {\n headers: Headers;\n};\nexport type revokeInviteResponseError = (\n | revokeInviteResponse400\n | revokeInviteResponse403\n | revokeInviteResponse404\n) & {\n headers: Headers;\n};\n\nexport type revokeInviteResponse =\n | revokeInviteResponseSuccess\n | revokeInviteResponseError;\n\nexport const getRevokeInviteUrl = (userId: string) => {\n return `https://api.workos.com/_widgets/UserManagement/invites/${userId}`;\n};\n\nexport const revokeInvite = async (\n userId: string,\n options?: RequestInit,\n): Promise<revokeInviteResponse> => {\n const res = await fetch(getRevokeInviteUrl(userId), {\n ...options,\n method: \"DELETE\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: revokeInviteResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as revokeInviteResponse;\n};\n\nexport const getRevokeInviteMutationFetcher = (\n userId: string,\n options?: RequestInit,\n) => {\n return (_: Key, __: { arg: Arguments }) => {\n return revokeInvite(userId, options);\n };\n};\nexport const getRevokeInviteMutationKey = (userId: string) =>\n [`https://api.workos.com/_widgets/UserManagement/invites/${userId}`] as const;\n\nexport type RevokeInviteMutationResult = NonNullable<\n Awaited<ReturnType<typeof revokeInvite>>\n>;\nexport type RevokeInviteMutationError = Promise<\n RevokeInvite400 | RevokeInvite403 | RevokeInvite404\n>;\n\nexport const useRevokeInvite = <\n TError = Promise<RevokeInvite400 | RevokeInvite403 | RevokeInvite404>,\n>(\n userId: string,\n options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof revokeInvite>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof revokeInvite>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getRevokeInviteMutationKey(userId);\n const swrFn = getRevokeInviteMutationFetcher(userId, fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type removeMemberResponse200 = {\n data: RemoveMember200;\n status: 200;\n};\n\nexport type removeMemberResponse400 = {\n data: RemoveMember400;\n status: 400;\n};\n\nexport type removeMemberResponse403 = {\n data: RemoveMember403;\n status: 403;\n};\n\nexport type removeMemberResponse404 = {\n data: RemoveMember404;\n status: 404;\n};\n\nexport type removeMemberResponseSuccess = removeMemberResponse200 & {\n headers: Headers;\n};\nexport type removeMemberResponseError = (\n | removeMemberResponse400\n | removeMemberResponse403\n | removeMemberResponse404\n) & {\n headers: Headers;\n};\n\nexport type removeMemberResponse =\n | removeMemberResponseSuccess\n | removeMemberResponseError;\n\nexport const getRemoveMemberUrl = (userId: string) => {\n return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;\n};\n\nexport const removeMember = async (\n userId: string,\n options?: RequestInit,\n): Promise<removeMemberResponse> => {\n const res = await fetch(getRemoveMemberUrl(userId), {\n ...options,\n method: \"DELETE\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: removeMemberResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as removeMemberResponse;\n};\n\nexport const getRemoveMemberMutationFetcher = (\n userId: string,\n options?: RequestInit,\n) => {\n return (_: Key, __: { arg: Arguments }) => {\n return removeMember(userId, options);\n };\n};\nexport const getRemoveMemberMutationKey = (userId: string) =>\n [`https://api.workos.com/_widgets/UserManagement/members/${userId}`] as const;\n\nexport type RemoveMemberMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeMember>>\n>;\nexport type RemoveMemberMutationError = Promise<\n RemoveMember400 | RemoveMember403 | RemoveMember404\n>;\n\nexport const useRemoveMember = <\n TError = Promise<RemoveMember400 | RemoveMember403 | RemoveMember404>,\n>(\n userId: string,\n options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof removeMember>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof removeMember>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getRemoveMemberMutationKey(userId);\n const swrFn = getRemoveMemberMutationFetcher(userId, fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type updateMemberResponse200 = {\n data: UpdateMember200;\n status: 200;\n};\n\nexport type updateMemberResponse400 = {\n data: UpdateMember400;\n status: 400;\n};\n\nexport type updateMemberResponse403 = {\n data: UpdateMember403;\n status: 403;\n};\n\nexport type updateMemberResponse404 = {\n data: UpdateMember404;\n status: 404;\n};\n\nexport type updateMemberResponse422 = {\n data: UpdateMember422;\n status: 422;\n};\n\nexport type updateMemberResponseSuccess = updateMemberResponse200 & {\n headers: Headers;\n};\nexport type updateMemberResponseError = (\n | updateMemberResponse400\n | updateMemberResponse403\n | updateMemberResponse404\n | updateMemberResponse422\n) & {\n headers: Headers;\n};\n\nexport type updateMemberResponse =\n | updateMemberResponseSuccess\n | updateMemberResponseError;\n\nexport const getUpdateMemberUrl = (userId: string) => {\n return `https://api.workos.com/_widgets/UserManagement/members/${userId}`;\n};\n\nexport const updateMember = async (\n userId: string,\n updateMemberBody: UpdateMemberBody,\n options?: RequestInit,\n): Promise<updateMemberResponse> => {\n const res = await fetch(getUpdateMemberUrl(userId), {\n ...options,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", ...options?.headers },\n body: JSON.stringify(updateMemberBody),\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: updateMemberResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as updateMemberResponse;\n};\n\nexport const getUpdateMemberMutationFetcher = (\n userId: string,\n options?: RequestInit,\n) => {\n return (_: Key, { arg }: { arg: UpdateMemberBody }) => {\n return updateMember(userId, arg, options);\n };\n};\nexport const getUpdateMemberMutationKey = (userId: string) =>\n [`https://api.workos.com/_widgets/UserManagement/members/${userId}`] as const;\n\nexport type UpdateMemberMutationResult = NonNullable<\n Awaited<ReturnType<typeof updateMember>>\n>;\nexport type UpdateMemberMutationError = Promise<\n UpdateMember400 | UpdateMember403 | UpdateMember404 | UpdateMember422\n>;\n\nexport const useUpdateMember = <\n TError = Promise<\n UpdateMember400 | UpdateMember403 | UpdateMember404 | UpdateMember422\n >,\n>(\n userId: string,\n options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof updateMember>>,\n TError,\n Key,\n UpdateMemberBody,\n Awaited<ReturnType<typeof updateMember>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getUpdateMemberMutationKey(userId);\n const swrFn = getUpdateMemberMutationFetcher(userId, fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type organizationsResponse200 = {\n data: OrganizationsResponse;\n status: 200;\n};\n\nexport type organizationsResponse403 = {\n data: Organizations403;\n status: 403;\n};\n\nexport type organizationsResponse404 = {\n data: Organizations404;\n status: 404;\n};\n\nexport type organizationsResponseSuccess = organizationsResponse200 & {\n headers: Headers;\n};\nexport type organizationsResponseError = (\n | organizationsResponse403\n | organizationsResponse404\n) & {\n headers: Headers;\n};\n\nexport type organizationsResponse =\n | organizationsResponseSuccess\n | organizationsResponseError;\n\nexport const getOrganizationsUrl = () => {\n return `https://api.workos.com/_widgets/UserManagement/organizations`;\n};\n\nexport const organizations = async (\n options?: RequestInit,\n): Promise<organizationsResponse> => {\n const res = await fetch(getOrganizationsUrl(), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: organizationsResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as organizationsResponse;\n};\n\nexport const getOrganizationsKey = () =>\n [`https://api.workos.com/_widgets/UserManagement/organizations`] as const;\n\nexport type OrganizationsQueryResult = NonNullable<\n Awaited<ReturnType<typeof organizations>>\n>;\nexport type OrganizationsQueryError = Promise<\n Organizations403 | Organizations404\n>;\n\nexport const useOrganizations = <\n TError = Promise<Organizations403 | Organizations404>,\n>(options?: {\n swr?: SWRConfiguration<Awaited<ReturnType<typeof organizations>>, TError> & {\n swrKey?: Key;\n enabled?: boolean;\n };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey =\n swrOptions?.swrKey ?? (() => (isEnabled ? getOrganizationsKey() : null));\n const swrFn = () => organizations(fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type meResponse200 = {\n data: Me;\n status: 200;\n};\n\nexport type meResponse403 = {\n data: Me403;\n status: 403;\n};\n\nexport type meResponseSuccess = meResponse200 & {\n headers: Headers;\n};\nexport type meResponseError = meResponse403 & {\n headers: Headers;\n};\n\nexport type meResponse = meResponseSuccess | meResponseError;\n\nexport const getMeUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/me`;\n};\n\nexport const me = async (options?: RequestInit): Promise<meResponse> => {\n const res = await fetch(getMeUrl(), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: meResponse[\"data\"] = body ? JSON.parse(body) : {};\n return { data, status: res.status, headers: res.headers } as meResponse;\n};\n\nexport const getMeKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/me`] as const;\n\nexport type MeQueryResult = NonNullable<Awaited<ReturnType<typeof me>>>;\nexport type MeQueryError = Promise<Me403>;\n\nexport const useMe = <TError = Promise<Me403>>(options?: {\n swr?: SWRConfiguration<Awaited<ReturnType<typeof me>>, TError> & {\n swrKey?: Key;\n enabled?: boolean;\n };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey = swrOptions?.swrKey ?? (() => (isEnabled ? getMeKey() : null));\n const swrFn = () => me(fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type updateMeResponse200 = {\n data: Me;\n status: 200;\n};\n\nexport type updateMeResponse400 = {\n data: UpdateMe400;\n status: 400;\n};\n\nexport type updateMeResponse403 = {\n data: UpdateMe403;\n status: 403;\n};\n\nexport type updateMeResponseSuccess = updateMeResponse200 & {\n headers: Headers;\n};\nexport type updateMeResponseError = (\n | updateMeResponse400\n | updateMeResponse403\n) & {\n headers: Headers;\n};\n\nexport type updateMeResponse = updateMeResponseSuccess | updateMeResponseError;\n\nexport const getUpdateMeUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/me`;\n};\n\nexport const updateMe = async (\n updateMeBody: UpdateMeBody,\n options?: RequestInit,\n): Promise<updateMeResponse> => {\n const res = await fetch(getUpdateMeUrl(), {\n ...options,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", ...options?.headers },\n body: JSON.stringify(updateMeBody),\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: updateMeResponse[\"data\"] = body ? JSON.parse(body) : {};\n return { data, status: res.status, headers: res.headers } as updateMeResponse;\n};\n\nexport const getUpdateMeMutationFetcher = (options?: RequestInit) => {\n return (_: Key, { arg }: { arg: UpdateMeBody }) => {\n return updateMe(arg, options);\n };\n};\nexport const getUpdateMeMutationKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/me`] as const;\n\nexport type UpdateMeMutationResult = NonNullable<\n Awaited<ReturnType<typeof updateMe>>\n>;\nexport type UpdateMeMutationError = Promise<UpdateMe400 | UpdateMe403>;\n\nexport const useUpdateMe = <\n TError = Promise<UpdateMe400 | UpdateMe403>,\n>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof updateMe>>,\n TError,\n Key,\n UpdateMeBody,\n Awaited<ReturnType<typeof updateMe>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getUpdateMeMutationKey();\n const swrFn = getUpdateMeMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type createTotpFactorResponse201 = {\n data: CreateTotpFactorResponse;\n status: 201;\n};\n\nexport type createTotpFactorResponse400 = {\n data: CreateTotpFactor400;\n status: 400;\n};\n\nexport type createTotpFactorResponse403 = {\n data: CreateTotpFactor403;\n status: 403;\n};\n\nexport type createTotpFactorResponseSuccess = createTotpFactorResponse201 & {\n headers: Headers;\n};\nexport type createTotpFactorResponseError = (\n | createTotpFactorResponse400\n | createTotpFactorResponse403\n) & {\n headers: Headers;\n};\n\nexport type createTotpFactorResponse =\n | createTotpFactorResponseSuccess\n | createTotpFactorResponseError;\n\nexport const getCreateTotpFactorUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/create-totp-factor`;\n};\n\nexport const createTotpFactor = async (\n options?: RequestInit,\n): Promise<createTotpFactorResponse> => {\n const res = await fetch(getCreateTotpFactorUrl(), {\n ...options,\n method: \"POST\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: createTotpFactorResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as createTotpFactorResponse;\n};\n\nexport const getCreateTotpFactorMutationFetcher = (options?: RequestInit) => {\n return (_: Key, __: { arg: Arguments }) => {\n return createTotpFactor(options);\n };\n};\nexport const getCreateTotpFactorMutationKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/create-totp-factor`] as const;\n\nexport type CreateTotpFactorMutationResult = NonNullable<\n Awaited<ReturnType<typeof createTotpFactor>>\n>;\nexport type CreateTotpFactorMutationError = Promise<\n CreateTotpFactor400 | CreateTotpFactor403\n>;\n\nexport const useCreateTotpFactor = <\n TError = Promise<CreateTotpFactor400 | CreateTotpFactor403>,\n>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof createTotpFactor>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof createTotpFactor>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getCreateTotpFactorMutationKey();\n const swrFn = getCreateTotpFactorMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type verifyTotpFactorResponse200 = {\n data: VerifyTotpFactor200;\n status: 200;\n};\n\nexport type verifyTotpFactorResponse400 = {\n data: VerifyTotpFactor400;\n status: 400;\n};\n\nexport type verifyTotpFactorResponse403 = {\n data: VerifyTotpFactor403;\n status: 403;\n};\n\nexport type verifyTotpFactorResponseSuccess = verifyTotpFactorResponse200 & {\n headers: Headers;\n};\nexport type verifyTotpFactorResponseError = (\n | verifyTotpFactorResponse400\n | verifyTotpFactorResponse403\n) & {\n headers: Headers;\n};\n\nexport type verifyTotpFactorResponse =\n | verifyTotpFactorResponseSuccess\n | verifyTotpFactorResponseError;\n\nexport const getVerifyTotpFactorUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/verify-totp-factor`;\n};\n\nexport const verifyTotpFactor = async (\n verifyTotpFactorRequest: VerifyTotpFactorRequest,\n options?: RequestInit,\n): Promise<verifyTotpFactorResponse> => {\n const res = await fetch(getVerifyTotpFactorUrl(), {\n ...options,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", ...options?.headers },\n body: JSON.stringify(verifyTotpFactorRequest),\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: verifyTotpFactorResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as verifyTotpFactorResponse;\n};\n\nexport const getVerifyTotpFactorMutationFetcher = (options?: RequestInit) => {\n return (_: Key, { arg }: { arg: VerifyTotpFactorRequest }) => {\n return verifyTotpFactor(arg, options);\n };\n};\nexport const getVerifyTotpFactorMutationKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/verify-totp-factor`] as const;\n\nexport type VerifyTotpFactorMutationResult = NonNullable<\n Awaited<ReturnType<typeof verifyTotpFactor>>\n>;\nexport type VerifyTotpFactorMutationError = Promise<\n VerifyTotpFactor400 | VerifyTotpFactor403\n>;\n\nexport const useVerifyTotpFactor = <\n TError = Promise<VerifyTotpFactor400 | VerifyTotpFactor403>,\n>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof verifyTotpFactor>>,\n TError,\n Key,\n VerifyTotpFactorRequest,\n Awaited<ReturnType<typeof verifyTotpFactor>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getVerifyTotpFactorMutationKey();\n const swrFn = getVerifyTotpFactorMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type deleteTotpFactorsResponse200 = {\n data: DeleteTotpFactors200;\n status: 200;\n};\n\nexport type deleteTotpFactorsResponse400 = {\n data: DeleteTotpFactors400;\n status: 400;\n};\n\nexport type deleteTotpFactorsResponse403 = {\n data: DeleteTotpFactors403;\n status: 403;\n};\n\nexport type deleteTotpFactorsResponseSuccess = deleteTotpFactorsResponse200 & {\n headers: Headers;\n};\nexport type deleteTotpFactorsResponseError = (\n | deleteTotpFactorsResponse400\n | deleteTotpFactorsResponse403\n) & {\n headers: Headers;\n};\n\nexport type deleteTotpFactorsResponse =\n | deleteTotpFactorsResponseSuccess\n | deleteTotpFactorsResponseError;\n\nexport const getDeleteTotpFactorsUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/totp-factors`;\n};\n\nexport const deleteTotpFactors = async (\n options?: RequestInit,\n): Promise<deleteTotpFactorsResponse> => {\n const res = await fetch(getDeleteTotpFactorsUrl(), {\n ...options,\n method: \"DELETE\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: deleteTotpFactorsResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as deleteTotpFactorsResponse;\n};\n\nexport const getDeleteTotpFactorsMutationFetcher = (options?: RequestInit) => {\n return (_: Key, __: { arg: Arguments }) => {\n return deleteTotpFactors(options);\n };\n};\nexport const getDeleteTotpFactorsMutationKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/totp-factors`] as const;\n\nexport type DeleteTotpFactorsMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteTotpFactors>>\n>;\nexport type DeleteTotpFactorsMutationError = Promise<\n DeleteTotpFactors400 | DeleteTotpFactors403\n>;\n\nexport const useDeleteTotpFactors = <\n TError = Promise<DeleteTotpFactors400 | DeleteTotpFactors403>,\n>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof deleteTotpFactors>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof deleteTotpFactors>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getDeleteTotpFactorsMutationKey();\n const swrFn = getDeleteTotpFactorsMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type authenticationInformationResponse200 = {\n data: AuthenticationInformationResponse;\n status: 200;\n};\n\nexport type authenticationInformationResponse403 = {\n data: AuthenticationInformation403;\n status: 403;\n};\n\nexport type authenticationInformationResponseSuccess =\n authenticationInformationResponse200 & {\n headers: Headers;\n };\nexport type authenticationInformationResponseError =\n authenticationInformationResponse403 & {\n headers: Headers;\n };\n\nexport type authenticationInformationResponse =\n | authenticationInformationResponseSuccess\n | authenticationInformationResponseError;\n\nexport const getAuthenticationInformationUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/authentication-information`;\n};\n\nexport const authenticationInformation = async (\n options?: RequestInit,\n): Promise<authenticationInformationResponse> => {\n const res = await fetch(getAuthenticationInformationUrl(), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: authenticationInformationResponse[\"data\"] = body\n ? JSON.parse(body)\n : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as authenticationInformationResponse;\n};\n\nexport const getAuthenticationInformationKey = () =>\n [\n `https://api.workos.com/_widgets/UserProfile/authentication-information`,\n ] as const;\n\nexport type AuthenticationInformationQueryResult = NonNullable<\n Awaited<ReturnType<typeof authenticationInformation>>\n>;\nexport type AuthenticationInformationQueryError =\n Promise<AuthenticationInformation403>;\n\nexport const useAuthenticationInformation = <\n TError = Promise<AuthenticationInformation403>,\n>(options?: {\n swr?: SWRConfiguration<\n Awaited<ReturnType<typeof authenticationInformation>>,\n TError\n > & { swrKey?: Key; enabled?: boolean };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey =\n swrOptions?.swrKey ??\n (() => (isEnabled ? getAuthenticationInformationKey() : null));\n const swrFn = () => authenticationInformation(fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type createPasswordResponse201 = {\n data: CreatePassword201;\n status: 201;\n};\n\nexport type createPasswordResponse400 = {\n data: CreatePassword400;\n status: 400;\n};\n\nexport type createPasswordResponse403 = {\n data: CreatePassword403;\n status: 403;\n};\n\nexport type createPasswordResponseSuccess = createPasswordResponse201 & {\n headers: Headers;\n};\nexport type createPasswordResponseError = (\n | createPasswordResponse400\n | createPasswordResponse403\n) & {\n headers: Headers;\n};\n\nexport type createPasswordResponse =\n | createPasswordResponseSuccess\n | createPasswordResponseError;\n\nexport const getCreatePasswordUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/create-password`;\n};\n\nexport const createPassword = async (\n createPasswordRequest: CreatePasswordRequest,\n options?: RequestInit,\n): Promise<createPasswordResponse> => {\n const res = await fetch(getCreatePasswordUrl(), {\n ...options,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", ...options?.headers },\n body: JSON.stringify(createPasswordRequest),\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: createPasswordResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as createPasswordResponse;\n};\n\nexport const getCreatePasswordMutationFetcher = (options?: RequestInit) => {\n return (_: Key, { arg }: { arg: CreatePasswordRequest }) => {\n return createPassword(arg, options);\n };\n};\nexport const getCreatePasswordMutationKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/create-password`] as const;\n\nexport type CreatePasswordMutationResult = NonNullable<\n Awaited<ReturnType<typeof createPassword>>\n>;\nexport type CreatePasswordMutationError = Promise<\n CreatePassword400 | CreatePassword403\n>;\n\nexport const useCreatePassword = <\n TError = Promise<CreatePassword400 | CreatePassword403>,\n>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof createPassword>>,\n TError,\n Key,\n CreatePasswordRequest,\n Awaited<ReturnType<typeof createPassword>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getCreatePasswordMutationKey();\n const swrFn = getCreatePasswordMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type updatePasswordResponse201 = {\n data: UpdatePassword201;\n status: 201;\n};\n\nexport type updatePasswordResponse400 = {\n data: UpdatePassword400;\n status: 400;\n};\n\nexport type updatePasswordResponse403 = {\n data: UpdatePassword403;\n status: 403;\n};\n\nexport type updatePasswordResponseSuccess = updatePasswordResponse201 & {\n headers: Headers;\n};\nexport type updatePasswordResponseError = (\n | updatePasswordResponse400\n | updatePasswordResponse403\n) & {\n headers: Headers;\n};\n\nexport type updatePasswordResponse =\n | updatePasswordResponseSuccess\n | updatePasswordResponseError;\n\nexport const getUpdatePasswordUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/update-password`;\n};\n\nexport const updatePassword = async (\n updatePasswordRequest: UpdatePasswordRequest,\n options?: RequestInit,\n): Promise<updatePasswordResponse> => {\n const res = await fetch(getUpdatePasswordUrl(), {\n ...options,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", ...options?.headers },\n body: JSON.stringify(updatePasswordRequest),\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: updatePasswordResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as updatePasswordResponse;\n};\n\nexport const getUpdatePasswordMutationFetcher = (options?: RequestInit) => {\n return (_: Key, { arg }: { arg: UpdatePasswordRequest }) => {\n return updatePassword(arg, options);\n };\n};\nexport const getUpdatePasswordMutationKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/update-password`] as const;\n\nexport type UpdatePasswordMutationResult = NonNullable<\n Awaited<ReturnType<typeof updatePassword>>\n>;\nexport type UpdatePasswordMutationError = Promise<\n UpdatePassword400 | UpdatePassword403\n>;\n\nexport const useUpdatePassword = <\n TError = Promise<UpdatePassword400 | UpdatePassword403>,\n>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof updatePassword>>,\n TError,\n Key,\n UpdatePasswordRequest,\n Awaited<ReturnType<typeof updatePassword>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getUpdatePasswordMutationKey();\n const swrFn = getUpdatePasswordMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type revokeAllSessionsResponse200 = {\n data: RevokeAllSessions200;\n status: 200;\n};\n\nexport type revokeAllSessionsResponse400 = {\n data: RevokeAllSessions400;\n status: 400;\n};\n\nexport type revokeAllSessionsResponse403 = {\n data: RevokeAllSessions403;\n status: 403;\n};\n\nexport type revokeAllSessionsResponseSuccess = revokeAllSessionsResponse200 & {\n headers: Headers;\n};\nexport type revokeAllSessionsResponseError = (\n | revokeAllSessionsResponse400\n | revokeAllSessionsResponse403\n) & {\n headers: Headers;\n};\n\nexport type revokeAllSessionsResponse =\n | revokeAllSessionsResponseSuccess\n | revokeAllSessionsResponseError;\n\nexport const getRevokeAllSessionsUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/sessions/revoke-all`;\n};\n\nexport const revokeAllSessions = async (\n revokeAllSessionsRequest: RevokeAllSessionsRequest,\n options?: RequestInit,\n): Promise<revokeAllSessionsResponse> => {\n const res = await fetch(getRevokeAllSessionsUrl(), {\n ...options,\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\", ...options?.headers },\n body: JSON.stringify(revokeAllSessionsRequest),\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: revokeAllSessionsResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as revokeAllSessionsResponse;\n};\n\nexport const getRevokeAllSessionsMutationFetcher = (options?: RequestInit) => {\n return (_: Key, { arg }: { arg: RevokeAllSessionsRequest }) => {\n return revokeAllSessions(arg, options);\n };\n};\nexport const getRevokeAllSessionsMutationKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/sessions/revoke-all`] as const;\n\nexport type RevokeAllSessionsMutationResult = NonNullable<\n Awaited<ReturnType<typeof revokeAllSessions>>\n>;\nexport type RevokeAllSessionsMutationError = Promise<\n RevokeAllSessions400 | RevokeAllSessions403\n>;\n\nexport const useRevokeAllSessions = <\n TError = Promise<RevokeAllSessions400 | RevokeAllSessions403>,\n>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof revokeAllSessions>>,\n TError,\n Key,\n RevokeAllSessionsRequest,\n Awaited<ReturnType<typeof revokeAllSessions>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getRevokeAllSessionsMutationKey();\n const swrFn = getRevokeAllSessionsMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type revokeSessionResponse200 = {\n data: RevokeSession200;\n status: 200;\n};\n\nexport type revokeSessionResponse400 = {\n data: RevokeSession400;\n status: 400;\n};\n\nexport type revokeSessionResponse403 = {\n data: RevokeSession403;\n status: 403;\n};\n\nexport type revokeSessionResponseSuccess = revokeSessionResponse200 & {\n headers: Headers;\n};\nexport type revokeSessionResponseError = (\n | revokeSessionResponse400\n | revokeSessionResponse403\n) & {\n headers: Headers;\n};\n\nexport type revokeSessionResponse =\n | revokeSessionResponseSuccess\n | revokeSessionResponseError;\n\nexport const getRevokeSessionUrl = (sessionId: string) => {\n return `https://api.workos.com/_widgets/UserProfile/sessions/revoke/${sessionId}`;\n};\n\nexport const revokeSession = async (\n sessionId: string,\n options?: RequestInit,\n): Promise<revokeSessionResponse> => {\n const res = await fetch(getRevokeSessionUrl(sessionId), {\n ...options,\n method: \"DELETE\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: revokeSessionResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as revokeSessionResponse;\n};\n\nexport const getRevokeSessionMutationFetcher = (\n sessionId: string,\n options?: RequestInit,\n) => {\n return (_: Key, __: { arg: Arguments }) => {\n return revokeSession(sessionId, options);\n };\n};\nexport const getRevokeSessionMutationKey = (sessionId: string) =>\n [\n `https://api.workos.com/_widgets/UserProfile/sessions/revoke/${sessionId}`,\n ] as const;\n\nexport type RevokeSessionMutationResult = NonNullable<\n Awaited<ReturnType<typeof revokeSession>>\n>;\nexport type RevokeSessionMutationError = Promise<\n RevokeSession400 | RevokeSession403\n>;\n\nexport const useRevokeSession = <\n TError = Promise<RevokeSession400 | RevokeSession403>,\n>(\n sessionId: string,\n options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof revokeSession>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof revokeSession>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getRevokeSessionMutationKey(sessionId);\n const swrFn = getRevokeSessionMutationFetcher(sessionId, fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type sessionsResponse200 = {\n data: ActiveSessionsResponse;\n status: 200;\n};\n\nexport type sessionsResponse403 = {\n data: Sessions403;\n status: 403;\n};\n\nexport type sessionsResponseSuccess = sessionsResponse200 & {\n headers: Headers;\n};\nexport type sessionsResponseError = sessionsResponse403 & {\n headers: Headers;\n};\n\nexport type sessionsResponse = sessionsResponseSuccess | sessionsResponseError;\n\nexport const getSessionsUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/sessions`;\n};\n\nexport const sessions = async (\n options?: RequestInit,\n): Promise<sessionsResponse> => {\n const res = await fetch(getSessionsUrl(), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: sessionsResponse[\"data\"] = body ? JSON.parse(body) : {};\n return { data, status: res.status, headers: res.headers } as sessionsResponse;\n};\n\nexport const getSessionsKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/sessions`] as const;\n\nexport type SessionsQueryResult = NonNullable<\n Awaited<ReturnType<typeof sessions>>\n>;\nexport type SessionsQueryError = Promise<Sessions403>;\n\nexport const useSessions = <TError = Promise<Sessions403>>(options?: {\n swr?: SWRConfiguration<Awaited<ReturnType<typeof sessions>>, TError> & {\n swrKey?: Key;\n enabled?: boolean;\n };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey =\n swrOptions?.swrKey ?? (() => (isEnabled ? getSessionsKey() : null));\n const swrFn = () => sessions(fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type sendVerificationResponse200 = {\n data: SendVerificationResponse;\n status: 200;\n};\n\nexport type sendVerificationResponse400 = {\n data: SendVerification400;\n status: 400;\n};\n\nexport type sendVerificationResponse403 = {\n data: SendVerification403;\n status: 403;\n};\n\nexport type sendVerificationResponseSuccess = sendVerificationResponse200 & {\n headers: Headers;\n};\nexport type sendVerificationResponseError = (\n | sendVerificationResponse400\n | sendVerificationResponse403\n) & {\n headers: Headers;\n};\n\nexport type sendVerificationResponse =\n | sendVerificationResponseSuccess\n | sendVerificationResponseError;\n\nexport const getSendVerificationUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/send-verification`;\n};\n\nexport const sendVerification = async (\n options?: RequestInit,\n): Promise<sendVerificationResponse> => {\n const res = await fetch(getSendVerificationUrl(), {\n ...options,\n method: \"POST\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: sendVerificationResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as sendVerificationResponse;\n};\n\nexport const getSendVerificationMutationFetcher = (options?: RequestInit) => {\n return (_: Key, __: { arg: Arguments }) => {\n return sendVerification(options);\n };\n};\nexport const getSendVerificationMutationKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/send-verification`] as const;\n\nexport type SendVerificationMutationResult = NonNullable<\n Awaited<ReturnType<typeof sendVerification>>\n>;\nexport type SendVerificationMutationError = Promise<\n SendVerification400 | SendVerification403\n>;\n\nexport const useSendVerification = <\n TError = Promise<SendVerification400 | SendVerification403>,\n>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof sendVerification>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof sendVerification>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getSendVerificationMutationKey();\n const swrFn = getSendVerificationMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type verifyResponse200 = {\n data: VerifyResponse;\n status: 200;\n};\n\nexport type verifyResponse400 = {\n data: Verify400;\n status: 400;\n};\n\nexport type verifyResponse403 = {\n data: Verify403;\n status: 403;\n};\n\nexport type verifyResponseSuccess = verifyResponse200 & {\n headers: Headers;\n};\nexport type verifyResponseError = (verifyResponse400 | verifyResponse403) & {\n headers: Headers;\n};\n\nexport type verifyResponse = verifyResponseSuccess | verifyResponseError;\n\nexport const getVerifyUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/verify`;\n};\n\nexport const verify = async (\n verifyRequest: VerifyRequest,\n options?: RequestInit,\n): Promise<verifyResponse> => {\n const res = await fetch(getVerifyUrl(), {\n ...options,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", ...options?.headers },\n body: JSON.stringify(verifyRequest),\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: verifyResponse[\"data\"] = body ? JSON.parse(body) : {};\n return { data, status: res.status, headers: res.headers } as verifyResponse;\n};\n\nexport const getVerifyMutationFetcher = (options?: RequestInit) => {\n return (_: Key, { arg }: { arg: VerifyRequest }) => {\n return verify(arg, options);\n };\n};\nexport const getVerifyMutationKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/verify`] as const;\n\nexport type VerifyMutationResult = NonNullable<\n Awaited<ReturnType<typeof verify>>\n>;\nexport type VerifyMutationError = Promise<Verify400 | Verify403>;\n\nexport const useVerify = <TError = Promise<Verify400 | Verify403>>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof verify>>,\n TError,\n Key,\n VerifyRequest,\n Awaited<ReturnType<typeof verify>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getVerifyMutationKey();\n const swrFn = getVerifyMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type registerPasskeyResponse201 = {\n data: RegisterPasskeyResponse;\n status: 201;\n};\n\nexport type registerPasskeyResponse400 = {\n data: RegisterPasskey400;\n status: 400;\n};\n\nexport type registerPasskeyResponse403 = {\n data: RegisterPasskey403;\n status: 403;\n};\n\nexport type registerPasskeyResponseSuccess = registerPasskeyResponse201 & {\n headers: Headers;\n};\nexport type registerPasskeyResponseError = (\n | registerPasskeyResponse400\n | registerPasskeyResponse403\n) & {\n headers: Headers;\n};\n\nexport type registerPasskeyResponse =\n | registerPasskeyResponseSuccess\n | registerPasskeyResponseError;\n\nexport const getRegisterPasskeyUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/passkeys`;\n};\n\nexport const registerPasskey = async (\n options?: RequestInit,\n): Promise<registerPasskeyResponse> => {\n const res = await fetch(getRegisterPasskeyUrl(), {\n ...options,\n method: \"POST\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: registerPasskeyResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as registerPasskeyResponse;\n};\n\nexport const getRegisterPasskeyMutationFetcher = (options?: RequestInit) => {\n return (_: Key, __: { arg: Arguments }) => {\n return registerPasskey(options);\n };\n};\nexport const getRegisterPasskeyMutationKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/passkeys`] as const;\n\nexport type RegisterPasskeyMutationResult = NonNullable<\n Awaited<ReturnType<typeof registerPasskey>>\n>;\nexport type RegisterPasskeyMutationError = Promise<\n RegisterPasskey400 | RegisterPasskey403\n>;\n\nexport const useRegisterPasskey = <\n TError = Promise<RegisterPasskey400 | RegisterPasskey403>,\n>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof registerPasskey>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof registerPasskey>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getRegisterPasskeyMutationKey();\n const swrFn = getRegisterPasskeyMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type verifyPasskeyResponse200 = {\n data: VerifyPasskey200;\n status: 200;\n};\n\nexport type verifyPasskeyResponse400 = {\n data: VerifyPasskey400;\n status: 400;\n};\n\nexport type verifyPasskeyResponse403 = {\n data: VerifyPasskey403;\n status: 403;\n};\n\nexport type verifyPasskeyResponseSuccess = verifyPasskeyResponse200 & {\n headers: Headers;\n};\nexport type verifyPasskeyResponseError = (\n | verifyPasskeyResponse400\n | verifyPasskeyResponse403\n) & {\n headers: Headers;\n};\n\nexport type verifyPasskeyResponse =\n | verifyPasskeyResponseSuccess\n | verifyPasskeyResponseError;\n\nexport const getVerifyPasskeyUrl = () => {\n return `https://api.workos.com/_widgets/UserProfile/passkeys/verify`;\n};\n\nexport const verifyPasskey = async (\n verifyPasskeyRequest: VerifyPasskeyRequest,\n options?: RequestInit,\n): Promise<verifyPasskeyResponse> => {\n const res = await fetch(getVerifyPasskeyUrl(), {\n ...options,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", ...options?.headers },\n body: JSON.stringify(verifyPasskeyRequest),\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: verifyPasskeyResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as verifyPasskeyResponse;\n};\n\nexport const getVerifyPasskeyMutationFetcher = (options?: RequestInit) => {\n return (_: Key, { arg }: { arg: VerifyPasskeyRequest }) => {\n return verifyPasskey(arg, options);\n };\n};\nexport const getVerifyPasskeyMutationKey = () =>\n [`https://api.workos.com/_widgets/UserProfile/passkeys/verify`] as const;\n\nexport type VerifyPasskeyMutationResult = NonNullable<\n Awaited<ReturnType<typeof verifyPasskey>>\n>;\nexport type VerifyPasskeyMutationError = Promise<\n VerifyPasskey400 | VerifyPasskey403\n>;\n\nexport const useVerifyPasskey = <\n TError = Promise<VerifyPasskey400 | VerifyPasskey403>,\n>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof verifyPasskey>>,\n TError,\n Key,\n VerifyPasskeyRequest,\n Awaited<ReturnType<typeof verifyPasskey>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getVerifyPasskeyMutationKey();\n const swrFn = getVerifyPasskeyMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type deletePasskeyResponse200 = {\n data: DeletePasskey200;\n status: 200;\n};\n\nexport type deletePasskeyResponse400 = {\n data: DeletePasskey400;\n status: 400;\n};\n\nexport type deletePasskeyResponse403 = {\n data: DeletePasskey403;\n status: 403;\n};\n\nexport type deletePasskeyResponseSuccess = deletePasskeyResponse200 & {\n headers: Headers;\n};\nexport type deletePasskeyResponseError = (\n | deletePasskeyResponse400\n | deletePasskeyResponse403\n) & {\n headers: Headers;\n};\n\nexport type deletePasskeyResponse =\n | deletePasskeyResponseSuccess\n | deletePasskeyResponseError;\n\nexport const getDeletePasskeyUrl = (passkeyId: string) => {\n return `https://api.workos.com/_widgets/UserProfile/passkeys/${passkeyId}`;\n};\n\nexport const deletePasskey = async (\n passkeyId: string,\n options?: RequestInit,\n): Promise<deletePasskeyResponse> => {\n const res = await fetch(getDeletePasskeyUrl(passkeyId), {\n ...options,\n method: \"DELETE\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: deletePasskeyResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as deletePasskeyResponse;\n};\n\nexport const getDeletePasskeyMutationFetcher = (\n passkeyId: string,\n options?: RequestInit,\n) => {\n return (_: Key, __: { arg: Arguments }) => {\n return deletePasskey(passkeyId, options);\n };\n};\nexport const getDeletePasskeyMutationKey = (passkeyId: string) =>\n [\n `https://api.workos.com/_widgets/UserProfile/passkeys/${passkeyId}`,\n ] as const;\n\nexport type DeletePasskeyMutationResult = NonNullable<\n Awaited<ReturnType<typeof deletePasskey>>\n>;\nexport type DeletePasskeyMutationError = Promise<\n DeletePasskey400 | DeletePasskey403\n>;\n\nexport const useDeletePasskey = <\n TError = Promise<DeletePasskey400 | DeletePasskey403>,\n>(\n passkeyId: string,\n options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof deletePasskey>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof deletePasskey>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getDeletePasskeyMutationKey(passkeyId);\n const swrFn = getDeletePasskeyMutationFetcher(passkeyId, fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type settingsResponse200 = {\n data: SettingsResponse;\n status: 200;\n};\n\nexport type settingsResponse403 = {\n data: Settings403;\n status: 403;\n};\n\nexport type settingsResponseSuccess = settingsResponse200 & {\n headers: Headers;\n};\nexport type settingsResponseError = settingsResponse403 & {\n headers: Headers;\n};\n\nexport type settingsResponse = settingsResponseSuccess | settingsResponseError;\n\nexport const getSettingsUrl = () => {\n return `https://api.workos.com/_widgets/settings`;\n};\n\nexport const settings = async (\n options?: RequestInit,\n): Promise<settingsResponse> => {\n const res = await fetch(getSettingsUrl(), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: settingsResponse[\"data\"] = body ? JSON.parse(body) : {};\n return { data, status: res.status, headers: res.headers } as settingsResponse;\n};\n\nexport const getSettingsKey = () =>\n [`https://api.workos.com/_widgets/settings`] as const;\n\nexport type SettingsQueryResult = NonNullable<\n Awaited<ReturnType<typeof settings>>\n>;\nexport type SettingsQueryError = Promise<Settings403>;\n\nexport const useSettings = <TError = Promise<Settings403>>(options?: {\n swr?: SWRConfiguration<Awaited<ReturnType<typeof settings>>, TError> & {\n swrKey?: Key;\n enabled?: boolean;\n };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey =\n swrOptions?.swrKey ?? (() => (isEnabled ? getSettingsKey() : null));\n const swrFn = () => settings(fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type listOrganizationDomainsResponse200 = {\n data: ListOrganizationDomains200;\n status: 200;\n};\n\nexport type listOrganizationDomainsResponse403 = {\n data: ListOrganizationDomains403;\n status: 403;\n};\n\nexport type listOrganizationDomainsResponse404 = {\n data: ListOrganizationDomains404;\n status: 404;\n};\n\nexport type listOrganizationDomainsResponseSuccess =\n listOrganizationDomainsResponse200 & {\n headers: Headers;\n };\nexport type listOrganizationDomainsResponseError = (\n | listOrganizationDomainsResponse403\n | listOrganizationDomainsResponse404\n) & {\n headers: Headers;\n};\n\nexport type listOrganizationDomainsResponse =\n | listOrganizationDomainsResponseSuccess\n | listOrganizationDomainsResponseError;\n\nexport const getListOrganizationDomainsUrl = () => {\n return `https://api.workos.com/_widgets/admin-portal/organization-domains`;\n};\n\nexport const listOrganizationDomains = async (\n options?: RequestInit,\n): Promise<listOrganizationDomainsResponse> => {\n const res = await fetch(getListOrganizationDomainsUrl(), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: listOrganizationDomainsResponse[\"data\"] = body\n ? JSON.parse(body)\n : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as listOrganizationDomainsResponse;\n};\n\nexport const getListOrganizationDomainsKey = () =>\n [\n `https://api.workos.com/_widgets/admin-portal/organization-domains`,\n ] as const;\n\nexport type ListOrganizationDomainsQueryResult = NonNullable<\n Awaited<ReturnType<typeof listOrganizationDomains>>\n>;\nexport type ListOrganizationDomainsQueryError = Promise<\n ListOrganizationDomains403 | ListOrganizationDomains404\n>;\n\nexport const useListOrganizationDomains = <\n TError = Promise<ListOrganizationDomains403 | ListOrganizationDomains404>,\n>(options?: {\n swr?: SWRConfiguration<\n Awaited<ReturnType<typeof listOrganizationDomains>>,\n TError\n > & { swrKey?: Key; enabled?: boolean };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey =\n swrOptions?.swrKey ??\n (() => (isEnabled ? getListOrganizationDomainsKey() : null));\n const swrFn = () => listOrganizationDomains(fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type generateAdminPortalLinkResponse201 = {\n data: GenerateAdminPortalLink201;\n status: 201;\n};\n\nexport type generateAdminPortalLinkResponse403 = {\n data: GenerateAdminPortalLink403;\n status: 403;\n};\n\nexport type generateAdminPortalLinkResponse404 = {\n data: GenerateAdminPortalLink404;\n status: 404;\n};\n\nexport type generateAdminPortalLinkResponse500 = {\n data: GenerateAdminPortalLink500;\n status: 500;\n};\n\nexport type generateAdminPortalLinkResponseSuccess =\n generateAdminPortalLinkResponse201 & {\n headers: Headers;\n };\nexport type generateAdminPortalLinkResponseError = (\n | generateAdminPortalLinkResponse403\n | generateAdminPortalLinkResponse404\n | generateAdminPortalLinkResponse500\n) & {\n headers: Headers;\n};\n\nexport type generateAdminPortalLinkResponse =\n | generateAdminPortalLinkResponseSuccess\n | generateAdminPortalLinkResponseError;\n\nexport const getGenerateAdminPortalLinkUrl = (\n params: GenerateAdminPortalLinkParams,\n) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : value.toString());\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `https://api.workos.com/_widgets/admin-portal/generate-link?${stringifiedParams}`\n : `https://api.workos.com/_widgets/admin-portal/generate-link`;\n};\n\nexport const generateAdminPortalLink = async (\n params: GenerateAdminPortalLinkParams,\n options?: RequestInit,\n): Promise<generateAdminPortalLinkResponse> => {\n const res = await fetch(getGenerateAdminPortalLinkUrl(params), {\n ...options,\n method: \"POST\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: generateAdminPortalLinkResponse[\"data\"] = body\n ? JSON.parse(body)\n : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as generateAdminPortalLinkResponse;\n};\n\nexport const getGenerateAdminPortalLinkMutationFetcher = (\n params: GenerateAdminPortalLinkParams,\n options?: RequestInit,\n) => {\n return (_: Key, __: { arg: Arguments }) => {\n return generateAdminPortalLink(params, options);\n };\n};\nexport const getGenerateAdminPortalLinkMutationKey = (\n params: GenerateAdminPortalLinkParams,\n) =>\n [\n `https://api.workos.com/_widgets/admin-portal/generate-link`,\n ...(params ? [params] : []),\n ] as const;\n\nexport type GenerateAdminPortalLinkMutationResult = NonNullable<\n Awaited<ReturnType<typeof generateAdminPortalLink>>\n>;\nexport type GenerateAdminPortalLinkMutationError = Promise<\n | GenerateAdminPortalLink403\n | GenerateAdminPortalLink404\n | GenerateAdminPortalLink500\n>;\n\nexport const useGenerateAdminPortalLink = <\n TError = Promise<\n | GenerateAdminPortalLink403\n | GenerateAdminPortalLink404\n | GenerateAdminPortalLink500\n >,\n>(\n params: GenerateAdminPortalLinkParams,\n options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof generateAdminPortalLink>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof generateAdminPortalLink>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey =\n swrOptions?.swrKey ?? getGenerateAdminPortalLinkMutationKey(params);\n const swrFn = getGenerateAdminPortalLinkMutationFetcher(params, fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type deleteOrganizationDomainResponse200 = {\n data: OrganizationDomain;\n status: 200;\n};\n\nexport type deleteOrganizationDomainResponse403 = {\n data: DeleteOrganizationDomain403;\n status: 403;\n};\n\nexport type deleteOrganizationDomainResponse404 = {\n data: DeleteOrganizationDomain404;\n status: 404;\n};\n\nexport type deleteOrganizationDomainResponseSuccess =\n deleteOrganizationDomainResponse200 & {\n headers: Headers;\n };\nexport type deleteOrganizationDomainResponseError = (\n | deleteOrganizationDomainResponse403\n | deleteOrganizationDomainResponse404\n) & {\n headers: Headers;\n};\n\nexport type deleteOrganizationDomainResponse =\n | deleteOrganizationDomainResponseSuccess\n | deleteOrganizationDomainResponseError;\n\nexport const getDeleteOrganizationDomainUrl = (domainId: string) => {\n return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}`;\n};\n\nexport const deleteOrganizationDomain = async (\n domainId: string,\n options?: RequestInit,\n): Promise<deleteOrganizationDomainResponse> => {\n const res = await fetch(getDeleteOrganizationDomainUrl(domainId), {\n ...options,\n method: \"DELETE\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: deleteOrganizationDomainResponse[\"data\"] = body\n ? JSON.parse(body)\n : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as deleteOrganizationDomainResponse;\n};\n\nexport const getDeleteOrganizationDomainMutationFetcher = (\n domainId: string,\n options?: RequestInit,\n) => {\n return (_: Key, __: { arg: Arguments }) => {\n return deleteOrganizationDomain(domainId, options);\n };\n};\nexport const getDeleteOrganizationDomainMutationKey = (domainId: string) =>\n [\n `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}`,\n ] as const;\n\nexport type DeleteOrganizationDomainMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganizationDomain>>\n>;\nexport type DeleteOrganizationDomainMutationError = Promise<\n DeleteOrganizationDomain403 | DeleteOrganizationDomain404\n>;\n\nexport const useDeleteOrganizationDomain = <\n TError = Promise<DeleteOrganizationDomain403 | DeleteOrganizationDomain404>,\n>(\n domainId: string,\n options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof deleteOrganizationDomain>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof deleteOrganizationDomain>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey =\n swrOptions?.swrKey ?? getDeleteOrganizationDomainMutationKey(domainId);\n const swrFn = getDeleteOrganizationDomainMutationFetcher(\n domainId,\n fetchOptions,\n );\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type reverifyOrganizationDomainResponse200 = {\n data: OrganizationDomain;\n status: 200;\n};\n\nexport type reverifyOrganizationDomainResponse403 = {\n data: ReverifyOrganizationDomain403;\n status: 403;\n};\n\nexport type reverifyOrganizationDomainResponse404 = {\n data: ReverifyOrganizationDomain404;\n status: 404;\n};\n\nexport type reverifyOrganizationDomainResponseSuccess =\n reverifyOrganizationDomainResponse200 & {\n headers: Headers;\n };\nexport type reverifyOrganizationDomainResponseError = (\n | reverifyOrganizationDomainResponse403\n | reverifyOrganizationDomainResponse404\n) & {\n headers: Headers;\n};\n\nexport type reverifyOrganizationDomainResponse =\n | reverifyOrganizationDomainResponseSuccess\n | reverifyOrganizationDomainResponseError;\n\nexport const getReverifyOrganizationDomainUrl = (domainId: string) => {\n return `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}/reverify`;\n};\n\nexport const reverifyOrganizationDomain = async (\n domainId: string,\n options?: RequestInit,\n): Promise<reverifyOrganizationDomainResponse> => {\n const res = await fetch(getReverifyOrganizationDomainUrl(domainId), {\n ...options,\n method: \"POST\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: reverifyOrganizationDomainResponse[\"data\"] = body\n ? JSON.parse(body)\n : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as reverifyOrganizationDomainResponse;\n};\n\nexport const getReverifyOrganizationDomainMutationFetcher = (\n domainId: string,\n options?: RequestInit,\n) => {\n return (_: Key, __: { arg: Arguments }) => {\n return reverifyOrganizationDomain(domainId, options);\n };\n};\nexport const getReverifyOrganizationDomainMutationKey = (domainId: string) =>\n [\n `https://api.workos.com/_widgets/admin-portal/organization-domains/${domainId}/reverify`,\n ] as const;\n\nexport type ReverifyOrganizationDomainMutationResult = NonNullable<\n Awaited<ReturnType<typeof reverifyOrganizationDomain>>\n>;\nexport type ReverifyOrganizationDomainMutationError = Promise<\n ReverifyOrganizationDomain403 | ReverifyOrganizationDomain404\n>;\n\nexport const useReverifyOrganizationDomain = <\n TError = Promise<\n ReverifyOrganizationDomain403 | ReverifyOrganizationDomain404\n >,\n>(\n domainId: string,\n options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof reverifyOrganizationDomain>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof reverifyOrganizationDomain>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey =\n swrOptions?.swrKey ?? getReverifyOrganizationDomainMutationKey(domainId);\n const swrFn = getReverifyOrganizationDomainMutationFetcher(\n domainId,\n fetchOptions,\n );\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type listSsoConnectionsResponse200 = {\n data: SsoConnection[];\n status: 200;\n};\n\nexport type listSsoConnectionsResponseSuccess =\n listSsoConnectionsResponse200 & {\n headers: Headers;\n };\nexport type listSsoConnectionsResponse = listSsoConnectionsResponseSuccess;\n\nexport const getListSsoConnectionsUrl = () => {\n return `https://api.workos.com/_widgets/admin-portal/sso-connections`;\n};\n\nexport const listSsoConnections = async (\n options?: RequestInit,\n): Promise<listSsoConnectionsResponse> => {\n const res = await fetch(getListSsoConnectionsUrl(), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: listSsoConnectionsResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as listSsoConnectionsResponse;\n};\n\nexport const getListSsoConnectionsKey = () =>\n [`https://api.workos.com/_widgets/admin-portal/sso-connections`] as const;\n\nexport type ListSsoConnectionsQueryResult = NonNullable<\n Awaited<ReturnType<typeof listSsoConnections>>\n>;\nexport type ListSsoConnectionsQueryError = Promise<unknown>;\n\nexport const useListSsoConnections = <TError = Promise<unknown>>(options?: {\n swr?: SWRConfiguration<\n Awaited<ReturnType<typeof listSsoConnections>>,\n TError\n > & { swrKey?: Key; enabled?: boolean };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey =\n swrOptions?.swrKey ??\n (() => (isEnabled ? getListSsoConnectionsKey() : null));\n const swrFn = () => listSsoConnections(fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type createOrganizationApiKeyResponse201 = {\n data: CreateOrganizationApiKeyResponse;\n status: 201;\n};\n\nexport type createOrganizationApiKeyResponse400 = {\n data: CreateOrganizationApiKey400;\n status: 400;\n};\n\nexport type createOrganizationApiKeyResponse403 = {\n data: CreateOrganizationApiKey403;\n status: 403;\n};\n\nexport type createOrganizationApiKeyResponse404 = {\n data: CreateOrganizationApiKey404;\n status: 404;\n};\n\nexport type createOrganizationApiKeyResponse422 = {\n data: CreateOrganizationApiKey422;\n status: 422;\n};\n\nexport type createOrganizationApiKeyResponseSuccess =\n createOrganizationApiKeyResponse201 & {\n headers: Headers;\n };\nexport type createOrganizationApiKeyResponseError = (\n | createOrganizationApiKeyResponse400\n | createOrganizationApiKeyResponse403\n | createOrganizationApiKeyResponse404\n | createOrganizationApiKeyResponse422\n) & {\n headers: Headers;\n};\n\nexport type createOrganizationApiKeyResponse =\n | createOrganizationApiKeyResponseSuccess\n | createOrganizationApiKeyResponseError;\n\nexport const getCreateOrganizationApiKeyUrl = () => {\n return `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;\n};\n\nexport const createOrganizationApiKey = async (\n createOrganizationApiKeyRequest: CreateOrganizationApiKeyRequest,\n options?: RequestInit,\n): Promise<createOrganizationApiKeyResponse> => {\n const res = await fetch(getCreateOrganizationApiKeyUrl(), {\n ...options,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", ...options?.headers },\n body: JSON.stringify(createOrganizationApiKeyRequest),\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: createOrganizationApiKeyResponse[\"data\"] = body\n ? JSON.parse(body)\n : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as createOrganizationApiKeyResponse;\n};\n\nexport const getCreateOrganizationApiKeyMutationFetcher = (\n options?: RequestInit,\n) => {\n return (_: Key, { arg }: { arg: CreateOrganizationApiKeyRequest }) => {\n return createOrganizationApiKey(arg, options);\n };\n};\nexport const getCreateOrganizationApiKeyMutationKey = () =>\n [`https://api.workos.com/_widgets/ApiKeys/organization-api-keys`] as const;\n\nexport type CreateOrganizationApiKeyMutationResult = NonNullable<\n Awaited<ReturnType<typeof createOrganizationApiKey>>\n>;\nexport type CreateOrganizationApiKeyMutationError = Promise<\n | CreateOrganizationApiKey400\n | CreateOrganizationApiKey403\n | CreateOrganizationApiKey404\n | CreateOrganizationApiKey422\n>;\n\nexport const useCreateOrganizationApiKey = <\n TError = Promise<\n | CreateOrganizationApiKey400\n | CreateOrganizationApiKey403\n | CreateOrganizationApiKey404\n | CreateOrganizationApiKey422\n >,\n>(options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof createOrganizationApiKey>>,\n TError,\n Key,\n CreateOrganizationApiKeyRequest,\n Awaited<ReturnType<typeof createOrganizationApiKey>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey = swrOptions?.swrKey ?? getCreateOrganizationApiKeyMutationKey();\n const swrFn = getCreateOrganizationApiKeyMutationFetcher(fetchOptions);\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type listOrganizationApiKeysResponse200 = {\n data: ListOrganizationApiKeysResponse;\n status: 200;\n};\n\nexport type listOrganizationApiKeysResponse400 = {\n data: ListOrganizationApiKeys400;\n status: 400;\n};\n\nexport type listOrganizationApiKeysResponse403 = {\n data: ListOrganizationApiKeys403;\n status: 403;\n};\n\nexport type listOrganizationApiKeysResponseSuccess =\n listOrganizationApiKeysResponse200 & {\n headers: Headers;\n };\nexport type listOrganizationApiKeysResponseError = (\n | listOrganizationApiKeysResponse400\n | listOrganizationApiKeysResponse403\n) & {\n headers: Headers;\n};\n\nexport type listOrganizationApiKeysResponse =\n | listOrganizationApiKeysResponseSuccess\n | listOrganizationApiKeysResponseError;\n\nexport const getListOrganizationApiKeysUrl = (\n params?: ListOrganizationApiKeysParams,\n) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : value.toString());\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `https://api.workos.com/_widgets/ApiKeys/organization-api-keys?${stringifiedParams}`\n : `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`;\n};\n\nexport const listOrganizationApiKeys = async (\n params?: ListOrganizationApiKeysParams,\n options?: RequestInit,\n): Promise<listOrganizationApiKeysResponse> => {\n const res = await fetch(getListOrganizationApiKeysUrl(params), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: listOrganizationApiKeysResponse[\"data\"] = body\n ? JSON.parse(body)\n : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as listOrganizationApiKeysResponse;\n};\n\nexport const getListOrganizationApiKeysKey = (\n params?: ListOrganizationApiKeysParams,\n) =>\n [\n `https://api.workos.com/_widgets/ApiKeys/organization-api-keys`,\n ...(params ? [params] : []),\n ] as const;\n\nexport type ListOrganizationApiKeysQueryResult = NonNullable<\n Awaited<ReturnType<typeof listOrganizationApiKeys>>\n>;\nexport type ListOrganizationApiKeysQueryError = Promise<\n ListOrganizationApiKeys400 | ListOrganizationApiKeys403\n>;\n\nexport const useListOrganizationApiKeys = <\n TError = Promise<ListOrganizationApiKeys400 | ListOrganizationApiKeys403>,\n>(\n params?: ListOrganizationApiKeysParams,\n options?: {\n swr?: SWRConfiguration<\n Awaited<ReturnType<typeof listOrganizationApiKeys>>,\n TError\n > & { swrKey?: Key; enabled?: boolean };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey =\n swrOptions?.swrKey ??\n (() => (isEnabled ? getListOrganizationApiKeysKey(params) : null));\n const swrFn = () => listOrganizationApiKeys(params, fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type listOrganizationApiKeyPermissionsResponse200 = {\n data: ListOrganizationApiKeyPermissionsResponse;\n status: 200;\n};\n\nexport type listOrganizationApiKeyPermissionsResponse400 = {\n data: ListOrganizationApiKeyPermissions400;\n status: 400;\n};\n\nexport type listOrganizationApiKeyPermissionsResponse403 = {\n data: ListOrganizationApiKeyPermissions403;\n status: 403;\n};\n\nexport type listOrganizationApiKeyPermissionsResponseSuccess =\n listOrganizationApiKeyPermissionsResponse200 & {\n headers: Headers;\n };\nexport type listOrganizationApiKeyPermissionsResponseError = (\n | listOrganizationApiKeyPermissionsResponse400\n | listOrganizationApiKeyPermissionsResponse403\n) & {\n headers: Headers;\n};\n\nexport type listOrganizationApiKeyPermissionsResponse =\n | listOrganizationApiKeyPermissionsResponseSuccess\n | listOrganizationApiKeyPermissionsResponseError;\n\nexport const getListOrganizationApiKeyPermissionsUrl = (\n params?: ListOrganizationApiKeyPermissionsParams,\n) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : value.toString());\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `https://api.workos.com/_widgets/ApiKeys/permissions?${stringifiedParams}`\n : `https://api.workos.com/_widgets/ApiKeys/permissions`;\n};\n\nexport const listOrganizationApiKeyPermissions = async (\n params?: ListOrganizationApiKeyPermissionsParams,\n options?: RequestInit,\n): Promise<listOrganizationApiKeyPermissionsResponse> => {\n const res = await fetch(getListOrganizationApiKeyPermissionsUrl(params), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: listOrganizationApiKeyPermissionsResponse[\"data\"] = body\n ? JSON.parse(body)\n : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as listOrganizationApiKeyPermissionsResponse;\n};\n\nexport const getListOrganizationApiKeyPermissionsKey = (\n params?: ListOrganizationApiKeyPermissionsParams,\n) =>\n [\n `https://api.workos.com/_widgets/ApiKeys/permissions`,\n ...(params ? [params] : []),\n ] as const;\n\nexport type ListOrganizationApiKeyPermissionsQueryResult = NonNullable<\n Awaited<ReturnType<typeof listOrganizationApiKeyPermissions>>\n>;\nexport type ListOrganizationApiKeyPermissionsQueryError = Promise<\n ListOrganizationApiKeyPermissions400 | ListOrganizationApiKeyPermissions403\n>;\n\nexport const useListOrganizationApiKeyPermissions = <\n TError = Promise<\n ListOrganizationApiKeyPermissions400 | ListOrganizationApiKeyPermissions403\n >,\n>(\n params?: ListOrganizationApiKeyPermissionsParams,\n options?: {\n swr?: SWRConfiguration<\n Awaited<ReturnType<typeof listOrganizationApiKeyPermissions>>,\n TError\n > & { swrKey?: Key; enabled?: boolean };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey =\n swrOptions?.swrKey ??\n (() =>\n isEnabled ? getListOrganizationApiKeyPermissionsKey(params) : null);\n const swrFn = () => listOrganizationApiKeyPermissions(params, fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type deleteOrganizationApiKeyResponse200 = {\n data: DeleteOrganizationApiKey200;\n status: 200;\n};\n\nexport type deleteOrganizationApiKeyResponse403 = {\n data: DeleteOrganizationApiKey403;\n status: 403;\n};\n\nexport type deleteOrganizationApiKeyResponse404 = {\n data: DeleteOrganizationApiKey404;\n status: 404;\n};\n\nexport type deleteOrganizationApiKeyResponseSuccess =\n deleteOrganizationApiKeyResponse200 & {\n headers: Headers;\n };\nexport type deleteOrganizationApiKeyResponseError = (\n | deleteOrganizationApiKeyResponse403\n | deleteOrganizationApiKeyResponse404\n) & {\n headers: Headers;\n};\n\nexport type deleteOrganizationApiKeyResponse =\n | deleteOrganizationApiKeyResponseSuccess\n | deleteOrganizationApiKeyResponseError;\n\nexport const getDeleteOrganizationApiKeyUrl = (apiKeyId: string) => {\n return `https://api.workos.com/_widgets/ApiKeys/${apiKeyId}`;\n};\n\nexport const deleteOrganizationApiKey = async (\n apiKeyId: string,\n options?: RequestInit,\n): Promise<deleteOrganizationApiKeyResponse> => {\n const res = await fetch(getDeleteOrganizationApiKeyUrl(apiKeyId), {\n ...options,\n method: \"DELETE\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: deleteOrganizationApiKeyResponse[\"data\"] = body\n ? JSON.parse(body)\n : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as deleteOrganizationApiKeyResponse;\n};\n\nexport const getDeleteOrganizationApiKeyMutationFetcher = (\n apiKeyId: string,\n options?: RequestInit,\n) => {\n return (_: Key, __: { arg: Arguments }) => {\n return deleteOrganizationApiKey(apiKeyId, options);\n };\n};\nexport const getDeleteOrganizationApiKeyMutationKey = (apiKeyId: string) =>\n [`https://api.workos.com/_widgets/ApiKeys/${apiKeyId}`] as const;\n\nexport type DeleteOrganizationApiKeyMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganizationApiKey>>\n>;\nexport type DeleteOrganizationApiKeyMutationError = Promise<\n DeleteOrganizationApiKey403 | DeleteOrganizationApiKey404\n>;\n\nexport const useDeleteOrganizationApiKey = <\n TError = Promise<DeleteOrganizationApiKey403 | DeleteOrganizationApiKey404>,\n>(\n apiKeyId: string,\n options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof deleteOrganizationApiKey>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof deleteOrganizationApiKey>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey =\n swrOptions?.swrKey ?? getDeleteOrganizationApiKeyMutationKey(apiKeyId);\n const swrFn = getDeleteOrganizationApiKeyMutationFetcher(\n apiKeyId,\n fetchOptions,\n );\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type myDataIntegrationsResponse200 = {\n data: DataIntegrationsResponse;\n status: 200;\n};\n\nexport type myDataIntegrationsResponse403 = {\n data: MyDataIntegrations403;\n status: 403;\n};\n\nexport type myDataIntegrationsResponseSuccess =\n myDataIntegrationsResponse200 & {\n headers: Headers;\n };\nexport type myDataIntegrationsResponseError = myDataIntegrationsResponse403 & {\n headers: Headers;\n};\n\nexport type myDataIntegrationsResponse =\n | myDataIntegrationsResponseSuccess\n | myDataIntegrationsResponseError;\n\nexport const getMyDataIntegrationsUrl = () => {\n return `https://api.workos.com/_widgets/DataIntegrations/mine`;\n};\n\nexport const myDataIntegrations = async (\n options?: RequestInit,\n): Promise<myDataIntegrationsResponse> => {\n const res = await fetch(getMyDataIntegrationsUrl(), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: myDataIntegrationsResponse[\"data\"] = body ? JSON.parse(body) : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as myDataIntegrationsResponse;\n};\n\nexport const getMyDataIntegrationsKey = () =>\n [`https://api.workos.com/_widgets/DataIntegrations/mine`] as const;\n\nexport type MyDataIntegrationsQueryResult = NonNullable<\n Awaited<ReturnType<typeof myDataIntegrations>>\n>;\nexport type MyDataIntegrationsQueryError = Promise<MyDataIntegrations403>;\n\nexport const useMyDataIntegrations = <\n TError = Promise<MyDataIntegrations403>,\n>(options?: {\n swr?: SWRConfiguration<\n Awaited<ReturnType<typeof myDataIntegrations>>,\n TError\n > & { swrKey?: Key; enabled?: boolean };\n fetch?: RequestInit;\n}) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false;\n const swrKey =\n swrOptions?.swrKey ??\n (() => (isEnabled ? getMyDataIntegrationsKey() : null));\n const swrFn = () => myDataIntegrations(fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type getDataIntegrationAuthorizeUrlResponse200 = {\n data: GetDataIntegrationAuthorizeUrlResponse;\n status: 200;\n};\n\nexport type getDataIntegrationAuthorizeUrlResponse400 = {\n data: GetDataIntegrationAuthorizeUrl400;\n status: 400;\n};\n\nexport type getDataIntegrationAuthorizeUrlResponse403 = {\n data: GetDataIntegrationAuthorizeUrl403;\n status: 403;\n};\n\nexport type getDataIntegrationAuthorizeUrlResponse404 = {\n data: GetDataIntegrationAuthorizeUrl404;\n status: 404;\n};\n\nexport type getDataIntegrationAuthorizeUrlResponseSuccess =\n getDataIntegrationAuthorizeUrlResponse200 & {\n headers: Headers;\n };\nexport type getDataIntegrationAuthorizeUrlResponseError = (\n | getDataIntegrationAuthorizeUrlResponse400\n | getDataIntegrationAuthorizeUrlResponse403\n | getDataIntegrationAuthorizeUrlResponse404\n) & {\n headers: Headers;\n};\n\nexport type getDataIntegrationAuthorizeUrlResponse =\n | getDataIntegrationAuthorizeUrlResponseSuccess\n | getDataIntegrationAuthorizeUrlResponseError;\n\nexport const getGetDataIntegrationAuthorizeUrlUrl = (\n slug: string,\n params?: GetDataIntegrationAuthorizeUrlParams,\n) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : value.toString());\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize?${stringifiedParams}`\n : `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`;\n};\n\nexport const getDataIntegrationAuthorizeUrl = async (\n slug: string,\n params?: GetDataIntegrationAuthorizeUrlParams,\n options?: RequestInit,\n): Promise<getDataIntegrationAuthorizeUrlResponse> => {\n const res = await fetch(getGetDataIntegrationAuthorizeUrlUrl(slug, params), {\n ...options,\n method: \"GET\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: getDataIntegrationAuthorizeUrlResponse[\"data\"] = body\n ? JSON.parse(body)\n : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as getDataIntegrationAuthorizeUrlResponse;\n};\n\nexport const getGetDataIntegrationAuthorizeUrlKey = (\n slug: string,\n params?: GetDataIntegrationAuthorizeUrlParams,\n) =>\n [\n `https://api.workos.com/_widgets/DataIntegrations/${slug}/authorize`,\n ...(params ? [params] : []),\n ] as const;\n\nexport type GetDataIntegrationAuthorizeUrlQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDataIntegrationAuthorizeUrl>>\n>;\nexport type GetDataIntegrationAuthorizeUrlQueryError = Promise<\n | GetDataIntegrationAuthorizeUrl400\n | GetDataIntegrationAuthorizeUrl403\n | GetDataIntegrationAuthorizeUrl404\n>;\n\nexport const useGetDataIntegrationAuthorizeUrl = <\n TError = Promise<\n | GetDataIntegrationAuthorizeUrl400\n | GetDataIntegrationAuthorizeUrl403\n | GetDataIntegrationAuthorizeUrl404\n >,\n>(\n slug: string,\n params?: GetDataIntegrationAuthorizeUrlParams,\n options?: {\n swr?: SWRConfiguration<\n Awaited<ReturnType<typeof getDataIntegrationAuthorizeUrl>>,\n TError\n > & { swrKey?: Key; enabled?: boolean };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled = swrOptions?.enabled !== false && !!slug;\n const swrKey =\n swrOptions?.swrKey ??\n (() =>\n isEnabled ? getGetDataIntegrationAuthorizeUrlKey(slug, params) : null);\n const swrFn = () =>\n getDataIntegrationAuthorizeUrl(slug, params, fetchOptions);\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type getDataInstallationAuthorizationStatusResponse200 = {\n data: GetAuthorizationStatusResponse;\n status: 200;\n};\n\nexport type getDataInstallationAuthorizationStatusResponse400 = {\n data: GetDataInstallationAuthorizationStatus400;\n status: 400;\n};\n\nexport type getDataInstallationAuthorizationStatusResponse403 = {\n data: GetDataInstallationAuthorizationStatus403;\n status: 403;\n};\n\nexport type getDataInstallationAuthorizationStatusResponse404 = {\n data: GetDataInstallationAuthorizationStatus404;\n status: 404;\n};\n\nexport type getDataInstallationAuthorizationStatusResponseSuccess =\n getDataInstallationAuthorizationStatusResponse200 & {\n headers: Headers;\n };\nexport type getDataInstallationAuthorizationStatusResponseError = (\n | getDataInstallationAuthorizationStatusResponse400\n | getDataInstallationAuthorizationStatusResponse403\n | getDataInstallationAuthorizationStatusResponse404\n) & {\n headers: Headers;\n};\n\nexport type getDataInstallationAuthorizationStatusResponse =\n | getDataInstallationAuthorizationStatusResponseSuccess\n | getDataInstallationAuthorizationStatusResponseError;\n\nexport const getGetDataInstallationAuthorizationStatusUrl = (\n dataIntegrationId: string,\n state: string,\n) => {\n return `https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`;\n};\n\nexport const getDataInstallationAuthorizationStatus = async (\n dataIntegrationId: string,\n state: string,\n options?: RequestInit,\n): Promise<getDataInstallationAuthorizationStatusResponse> => {\n const res = await fetch(\n getGetDataInstallationAuthorizationStatusUrl(dataIntegrationId, state),\n {\n ...options,\n method: \"GET\",\n },\n );\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: getDataInstallationAuthorizationStatusResponse[\"data\"] = body\n ? JSON.parse(body)\n : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as getDataInstallationAuthorizationStatusResponse;\n};\n\nexport const getGetDataInstallationAuthorizationStatusKey = (\n dataIntegrationId: string,\n state: string,\n) =>\n [\n `https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`,\n ] as const;\n\nexport type GetDataInstallationAuthorizationStatusQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDataInstallationAuthorizationStatus>>\n>;\nexport type GetDataInstallationAuthorizationStatusQueryError = Promise<\n | GetDataInstallationAuthorizationStatus400\n | GetDataInstallationAuthorizationStatus403\n | GetDataInstallationAuthorizationStatus404\n>;\n\nexport const useGetDataInstallationAuthorizationStatus = <\n TError = Promise<\n | GetDataInstallationAuthorizationStatus400\n | GetDataInstallationAuthorizationStatus403\n | GetDataInstallationAuthorizationStatus404\n >,\n>(\n dataIntegrationId: string,\n state: string,\n options?: {\n swr?: SWRConfiguration<\n Awaited<ReturnType<typeof getDataInstallationAuthorizationStatus>>,\n TError\n > & { swrKey?: Key; enabled?: boolean };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const isEnabled =\n swrOptions?.enabled !== false && !!(dataIntegrationId && state);\n const swrKey =\n swrOptions?.swrKey ??\n (() =>\n isEnabled\n ? getGetDataInstallationAuthorizationStatusKey(dataIntegrationId, state)\n : null);\n const swrFn = () =>\n getDataInstallationAuthorizationStatus(\n dataIntegrationId,\n state,\n fetchOptions,\n );\n\n const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>(\n swrKey,\n swrFn,\n swrOptions,\n );\n\n return {\n swrKey,\n ...query,\n };\n};\n\nexport type deleteDataInstallationResponse200 = {\n data: DeleteDataInstallation200;\n status: 200;\n};\n\nexport type deleteDataInstallationResponse403 = {\n data: DeleteDataInstallation403;\n status: 403;\n};\n\nexport type deleteDataInstallationResponse404 = {\n data: DeleteDataInstallation404;\n status: 404;\n};\n\nexport type deleteDataInstallationResponseSuccess =\n deleteDataInstallationResponse200 & {\n headers: Headers;\n };\nexport type deleteDataInstallationResponseError = (\n | deleteDataInstallationResponse403\n | deleteDataInstallationResponse404\n) & {\n headers: Headers;\n};\n\nexport type deleteDataInstallationResponse =\n | deleteDataInstallationResponseSuccess\n | deleteDataInstallationResponseError;\n\nexport const getDeleteDataInstallationUrl = (installationId: string) => {\n return `https://api.workos.com/_widgets/DataIntegrations/installations/${installationId}`;\n};\n\nexport const deleteDataInstallation = async (\n installationId: string,\n options?: RequestInit,\n): Promise<deleteDataInstallationResponse> => {\n const res = await fetch(getDeleteDataInstallationUrl(installationId), {\n ...options,\n method: \"DELETE\",\n });\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n\n const data: deleteDataInstallationResponse[\"data\"] = body\n ? JSON.parse(body)\n : {};\n return {\n data,\n status: res.status,\n headers: res.headers,\n } as deleteDataInstallationResponse;\n};\n\nexport const getDeleteDataInstallationMutationFetcher = (\n installationId: string,\n options?: RequestInit,\n) => {\n return (_: Key, __: { arg: Arguments }) => {\n return deleteDataInstallation(installationId, options);\n };\n};\nexport const getDeleteDataInstallationMutationKey = (installationId: string) =>\n [\n `https://api.workos.com/_widgets/DataIntegrations/installations/${installationId}`,\n ] as const;\n\nexport type DeleteDataInstallationMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteDataInstallation>>\n>;\nexport type DeleteDataInstallationMutationError = Promise<\n DeleteDataInstallation403 | DeleteDataInstallation404\n>;\n\nexport const useDeleteDataInstallation = <\n TError = Promise<DeleteDataInstallation403 | DeleteDataInstallation404>,\n>(\n installationId: string,\n options?: {\n swr?: SWRMutationConfiguration<\n Awaited<ReturnType<typeof deleteDataInstallation>>,\n TError,\n Key,\n Arguments,\n Awaited<ReturnType<typeof deleteDataInstallation>>\n > & { swrKey?: string };\n fetch?: RequestInit;\n },\n) => {\n const { swr: swrOptions, fetch: fetchOptions } = options ?? {};\n\n const swrKey =\n swrOptions?.swrKey ?? getDeleteDataInstallationMutationKey(installationId);\n const swrFn = getDeleteDataInstallationMutationFetcher(\n installationId,\n fetchOptions,\n );\n\n const query = useSWRMutation(swrKey, swrFn, swrOptions);\n\n return {\n swrKey,\n ...query,\n };\n};\n"],"mappings":"AAOA,OAAO,YAAY;AAGnB,OAAO,oBAAoB;AAIpB,MAAM,eAAe;AAAA,EAC1B,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,eAAe;AAAA,EACf,eAAe;AAAA,EACf,UAAU;AACZ;AAIO,MAAM,oBAAoB;AAAA,EAC/B,aAAa;AA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ACZ;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA,GAAG;AAAA,EACL;AACF;AAgCO,MAAM,+BAA+B,CAAC,mBAA2B;AACtE,SAAO,kEAAkE,cAAc;AACzF;AAEO,MAAM,yBAAyB,OACpC,gBACA,YAC4C;AAC5C,QAAM,MAAM,MAAM,MAAM,6BAA6B,cAAc,GAAG;AAAA,IACpE,GAAG;AAAA,IACH,QAAQ;AAAA,EACV,CAAC;AAED,QAAM,OAAO,CAAC,KAAK,KAAK,GAAG,EAAE,SAAS,IAAI,MAAM,IAAI,OAAO,MAAM,IAAI,KAAK;AAE1E,QAAM,OAA+C,OACjD,KAAK,MAAM,IAAI,IACf,CAAC;AACL,SAAO;AAAA,IACL;AAAA,IACA,QAAQ,IAAI;AAAA,IACZ,SAAS,IAAI;AAAA,EACf;AACF;AAEO,MAAM,2CAA2C,CACtD,gBACA,YACG;AACH,SAAO,CAAC,GAAQ,OAA2B;AACzC,WAAO,uBAAuB,gBAAgB,OAAO;AAAA,EACvD;AACF;AACO,MAAM,uCAAuC,CAAC,mBACnD;AAAA,EACE,kEAAkE,cAAc;AAClF;AASK,MAAM,4BAA4B,CAGvC,gBACA,YAUG;AACH,QAAM,EAAE,KAAK,YAAY,OAAO,aAAa,IAAI,WAAW,CAAC;AAE7D,QAAM,SACJ,YAAY,UAAU,qCAAqC,cAAc;AAC3E,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAQ,eAAe,QAAQ,OAAO,UAAU;AAEtD,SAAO;AAAA,IACL;AAAA,IACA,GAAG;AAAA,EACL;AACF;","names":[]}
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
useVerifyTotpFactor
|
|
19
19
|
} from "../api/endpoint.js";
|
|
20
20
|
import { useElevatedAccessToken } from "../api/api-provider.js";
|
|
21
|
-
import
|
|
21
|
+
import { Form } from "radix-ui";
|
|
22
22
|
import { Marker } from "./marker.js";
|
|
23
23
|
import { CopyButton } from "./copy-button.js";
|
|
24
24
|
import { useSecuritySettings } from "./use-security-settings.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/add-mfa-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Box,\n Code,\n Flex,\n Grid,\n Link,\n Separator,\n Text,\n VisuallyHidden,\n} from \"@radix-ui/themes\";\nimport * as React from \"react\";\nimport { type ReactNode } from \"react\";\nimport * as Otp from \"./otp-input.js\";\nimport { Dialog, Button } from \"./elements.js\";\nimport {\n CreateTotpFactorResponse,\n CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOf,\n useCreateTotpFactor,\n useVerifyTotpFactor,\n} from \"../api/endpoint.js\";\nimport { useElevatedAccessToken } from \"../api/api-provider.js\";\nimport * as Form from \"@radix-ui/react-form\";\nimport { Marker } from \"./marker.js\";\nimport { CopyButton } from \"./copy-button.js\";\nimport { useSecuritySettings } from \"./use-security-settings.js\";\nimport { ElevatedAccess } from \"./elevated-access.js\";\nimport { SaveButton } from \"./save-button.js\";\nimport { useDialogClose } from \"./use-dialog-close.js\";\nimport { Translation } from \"./i18n/translation.js\";\nimport { useTranslation } from \"./i18n/use-translation.js\";\n\ninterface AddMfaDialogProps extends Dialog.RootProps {\n children?: ReactNode;\n onSuccess?: () => void;\n}\n\nexport function AddMfaDialog({\n children,\n onSuccess,\n ...props\n}: AddMfaDialogProps) {\n const [open, setOpen] = React.useState(false);\n const [manuallyTriggered, setManuallyTriggered] = React.useState(false);\n const { elevatedAccess } = useElevatedAccessToken();\n const createAuthFactor = useCreateTotpFactor();\n\n const handleVerified = async () => {\n await createAuthFactor.mutateAsync(undefined);\n };\n\n const onTriggerClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (elevatedAccess && !createAuthFactor.data) {\n event.preventDefault();\n setManuallyTriggered(true);\n createAuthFactor.mutate(undefined, {\n onSuccess: () => {\n setOpen(true);\n },\n });\n } else {\n setManuallyTriggered(false);\n }\n };\n\n const handleClose = React.useCallback(() => {\n setOpen(false);\n }, []);\n\n return (\n <Dialog.Root\n {...props}\n open={props.open || open}\n onOpenChange={props.onOpenChange || setOpen}\n >\n <Dialog.Trigger\n onClick={onTriggerClick}\n // @ts-ignore I've to find a way to pass the loading state to the trigger\n loading={manuallyTriggered && createAuthFactor.isPending}\n >\n {children}\n </Dialog.Trigger>\n\n <Dialog.Content maxWidth=\"480px\">\n <ElevatedAccess onVerified={handleVerified}>\n <Content onClose={handleClose} totpFactor={createAuthFactor.data} />\n </ElevatedAccess>\n </Dialog.Content>\n </Dialog.Root>\n );\n}\n\ninterface ContentProps {\n totpFactor?: CreateTotpFactorResponse;\n onClose?: () => void;\n}\n\nfunction Content({ onClose, totpFactor }: ContentProps) {\n const securitySettings = useSecuritySettings();\n const translate = useTranslation();\n\n const [customError, setCustomError] = React.useState<string | null>(null);\n const totp = hasQrCode(totpFactor)\n ? totpFactor.authenticationFactor.totp\n : undefined;\n\n const verifyTotp = useVerifyTotpFactor({\n mutation: {\n onSuccess: ({ success }) => {\n if (!success) {\n setCustomError(\"Invalid passcode\");\n }\n },\n },\n });\n\n const serverError = verifyTotp.error || customError;\n const isSuccess = verifyTotp.isSuccess && !serverError;\n\n const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n setCustomError(null);\n\n const formData = new FormData(event.currentTarget);\n const otpCode = formData.get(\"otp-code\")?.toString();\n\n verifyTotp.mutate({\n data: {\n authenticationChallengeId: totpFactor?.authenticationChallenge.id ?? \"\",\n code: otpCode ?? \"\",\n },\n });\n };\n\n useDialogClose(isSuccess, () => {\n securitySettings.update(\"Mfa\", true);\n });\n\n return (\n <>\n <Dialog.Title mb=\"5\">\n <Translation\n defaultMessage=\"Set up an authenticator app\"\n id=\"Eu+kuO\"\n description=\"Title for setting up two-factor authentication\"\n />\n </Dialog.Title>\n\n <Form.Root onSubmit={handleSubmit}>\n <Grid columns=\"auto 1fr\" rows=\"repeat(4, auto)\" gapX=\"3\" gapY=\"1\">\n <Grid\n rows=\"subgrid\"\n gridRow=\"span 4\"\n style={{ placeItems: \"center\" }}\n >\n {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}\n <Marker>1</Marker>\n <Separator\n orientation=\"vertical\"\n size=\"4\"\n style={{ width: \"2px\" }}\n />\n {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}\n <Marker>2</Marker>\n <div />\n </Grid>\n\n <Grid rows=\"subgrid\" gridRow=\"span 4\">\n <Text as=\"p\" size=\"3\" weight=\"bold\">\n <Translation\n defaultMessage=\"Scan the QR code\"\n id=\"fTSp5u\"\n description=\"Heading for the QR code scanning step in MFA setup\"\n />\n </Text>\n <Flex direction=\"column\" gap=\"1\">\n <Text as=\"p\" size=\"2\">\n <Translation\n defaultMessage=\"Use an authenticator app like {onep}, {google}, {authy}, or {microsoft} to scan the QR code below.\"\n id=\"8xwdwI\"\n description=\"Instructions for scanning the QR code with authenticator apps\"\n values={{\n onep: (\n <Link\n href=\"https://1password.com/\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n // eslint-disable-next-line formatjs/no-literal-string-in-jsx\n >\n 1Password\n </Link>\n ),\n google: (\n <Link\n href=\"https://apps.apple.com/us/app/google-authenticator/id388497605\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n // eslint-disable-next-line formatjs/no-literal-string-in-jsx\n >\n Google Authenticator\n </Link>\n ),\n authy: (\n <Link\n href=\"https://authy.com/\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n // eslint-disable-next-line formatjs/no-literal-string-in-jsx\n >\n Authy\n </Link>\n ),\n microsoft: (\n <Link\n href=\"https://www.microsoft.com/en-gb/security/mobile-authenticator-app\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n // eslint-disable-next-line formatjs/no-literal-string-in-jsx\n >\n Microsoft Authenticator\n </Link>\n ),\n }}\n />\n </Text>\n <Flex align=\"center\" gap=\"5\" my=\"5\">\n <Grid\n position=\"relative\"\n width=\"160px\"\n height=\"160px\"\n p=\"2\"\n style={{\n border: \"1px solid var(--gray-7)\",\n borderRadius: \"var(--radius-4)\",\n background: \"var(--gray-2)\",\n overflow: \"hidden\",\n }}\n >\n {totp?.qr_code && (\n <Box asChild width=\"100%\" height=\"auto\">\n <img\n alt={translate({\n defaultMessage: \"Scan this QR code to enroll\",\n description: \"Alt text for QR code image\",\n id: \"wpbqFJ\",\n })}\n aria-describedby=\"secret-note\"\n height=\"160\"\n src={totp.qr_code}\n style={{ userSelect: \"none\", background: \"white\" }}\n width=\"160\"\n />\n </Box>\n )}\n </Grid>\n\n <Flex direction=\"column\" gap=\"1\" align=\"start\">\n <Text color=\"gray\" id=\"secret-note\" size=\"2\">\n <Translation\n defaultMessage=\"Can't scan the code?\"\n id=\"6/cdcS\"\n description=\"Question asking if user is unable to scan the QR code\"\n />\n </Text>\n\n <SecretDialog setupKey={totp?.secret ?? \"\"}>\n <Button\n variant=\"secondary\"\n size=\"1\"\n disabled={verifyTotp.isPending || isSuccess}\n >\n <Translation\n defaultMessage=\"View setup key\"\n id=\"q3eZjH\"\n description=\"Button text to view the manual setup key\"\n />\n </Button>\n </SecretDialog>\n </Flex>\n </Flex>\n </Flex>\n <Text as=\"p\" size=\"3\" weight=\"bold\">\n <Translation\n defaultMessage=\"Get verification passcode\"\n id=\"1kRd2b\"\n description=\"Heading for entering the verification code step\"\n />\n </Text>\n <Flex direction=\"column\" gap=\"4\">\n <Text as=\"p\" size=\"2\">\n <Translation\n defaultMessage=\"Enter the 6-digit passcode from your authenticator app.\"\n id=\"4/66bS\"\n description=\"Instructions for entering the verification passcode\"\n />\n </Text>\n\n <Flex direction=\"column\" gap=\"2\">\n <Otp.Root\n autoSubmit\n gap=\"3\"\n justify=\"start\"\n name=\"otp-code\"\n rows=\"48px\"\n columns=\"repeat(6, 48px)\"\n readOnly={verifyTotp.isPending || isSuccess}\n >\n <Otp.Input required autoFocus autoComplete=\"off\" />\n <Otp.Input required />\n <Otp.Input required />\n <Otp.Input required />\n <Otp.Input required />\n <Otp.Input required />\n </Otp.Root>\n\n {serverError && (\n <Text size=\"2\" color=\"red\">\n {getMutationErrorMessage(serverError)}\n </Text>\n )}\n </Flex>\n </Flex>\n </Grid>\n </Grid>\n\n <Flex mt=\"5\" gap=\"3\" justify=\"end\">\n <Dialog.Close>\n <Button\n variant=\"secondary\"\n disabled={verifyTotp.isPending || isSuccess}\n >\n <Translation\n defaultMessage=\"Cancel\"\n id=\"84pAvU\"\n description=\"Button text to cancel MFA setup\"\n />\n </Button>\n </Dialog.Close>\n\n <SaveButton\n type=\"submit\"\n loading={verifyTotp.isPending}\n done={isSuccess}\n onDone={onClose}\n >\n <Translation\n defaultMessage=\"Confirm\"\n id=\"WHthZi\"\n description=\"Button text to confirm MFA setup\"\n />\n </SaveButton>\n </Flex>\n </Form.Root>\n\n {/* mirror errors in a live region */}\n <VisuallyHidden asChild>\n <section aria-live=\"polite\">\n {getMutationErrorMessage(serverError)}\n </section>\n </VisuallyHidden>\n </>\n );\n}\n\ninterface SecretDialogProps extends React.PropsWithChildren {\n setupKey: string;\n}\n\nfunction SecretDialog({ children, setupKey }: SecretDialogProps) {\n return (\n <Dialog.Root>\n <Dialog.Trigger>{children}</Dialog.Trigger>\n <Dialog.Content\n maxWidth=\"90vw\"\n size={{ initial: \"3\", sm: \"4\" }}\n minWidth=\"300px\"\n width=\"fit-content\"\n >\n <Dialog.Title size=\"2\" weight=\"regular\">\n <Translation\n defaultMessage=\"Your setup key\"\n id=\"LleqNP\"\n description=\"Title for dialog showing the manual setup key\"\n />\n </Dialog.Title>\n <Dialog.Description>\n <Text size=\"6\">\n <Code variant=\"ghost\" style={{ letterSpacing: \"0.15rem\" }}>\n {setupKey}\n </Code>\n </Text>\n </Dialog.Description>\n\n <Flex align=\"center\" gap=\"3\" justify=\"end\" mt=\"5\">\n <Dialog.Close>\n <CopyButton value={setupKey}>\n <Translation\n defaultMessage=\"Copy and close\"\n id=\"EyjGir\"\n description=\"Button text to copy setup key and close dialog\"\n />\n </CopyButton>\n </Dialog.Close>\n </Flex>\n </Dialog.Content>\n </Dialog.Root>\n );\n}\n\nfunction getMutationErrorMessage(error: unknown) {\n let message = \"Something went wrong, please try again\";\n\n if (typeof error === \"string\") {\n message = error;\n }\n\n if (error instanceof Error) {\n message = error.message;\n }\n\n if (\n typeof error === \"object\" &&\n error !== null &&\n \"message\" in error &&\n typeof error.message === \"string\"\n ) {\n message = error.message;\n }\n\n if (message === \"Invalid passcode\") {\n message = \"Invalid passcode, please try again\";\n }\n\n return message;\n}\n\nfunction hasQrCode(\n response?: CreateTotpFactorResponse,\n): response is CreateTotpFactorResponse & {\n authenticationFactor: {\n totp: NonNullable<CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOf>;\n };\n} {\n const totp = response?.authenticationFactor.totp;\n return totp != null && \"qr_code\" in totp;\n}\n"],"mappings":";AAuEI,SAqEA,UAhEE,KALF;AArEJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,YAAY,WAAW;AAEvB,YAAY,SAAS;AACrB,SAAS,QAAQ,cAAc;AAC/B;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AACP,SAAS,8BAA8B;AACvC,YAAY,UAAU;AACtB,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAOxB,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,QAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAC5C,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,MAAM,SAAS,KAAK;AACtE,QAAM,EAAE,eAAe,IAAI,uBAAuB;AAClD,QAAM,mBAAm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";\n\nimport {\n Box,\n Code,\n Flex,\n Grid,\n Link,\n Separator,\n Text,\n VisuallyHidden,\n} from \"@radix-ui/themes\";\nimport * as React from \"react\";\nimport { type ReactNode } from \"react\";\nimport * as Otp from \"./otp-input.js\";\nimport { Dialog, Button } from \"./elements.js\";\nimport {\n CreateTotpFactorResponse,\n CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOf,\n useCreateTotpFactor,\n useVerifyTotpFactor,\n} from \"../api/endpoint.js\";\nimport { useElevatedAccessToken } from \"../api/api-provider.js\";\nimport { Form } from \"radix-ui\";\nimport { Marker } from \"./marker.js\";\nimport { CopyButton } from \"./copy-button.js\";\nimport { useSecuritySettings } from \"./use-security-settings.js\";\nimport { ElevatedAccess } from \"./elevated-access.js\";\nimport { SaveButton } from \"./save-button.js\";\nimport { useDialogClose } from \"./use-dialog-close.js\";\nimport { Translation } from \"./i18n/translation.js\";\nimport { useTranslation } from \"./i18n/use-translation.js\";\n\ninterface AddMfaDialogProps extends Dialog.RootProps {\n children?: ReactNode;\n onSuccess?: () => void;\n}\n\nexport function AddMfaDialog({\n children,\n onSuccess,\n ...props\n}: AddMfaDialogProps) {\n const [open, setOpen] = React.useState(false);\n const [manuallyTriggered, setManuallyTriggered] = React.useState(false);\n const { elevatedAccess } = useElevatedAccessToken();\n const createAuthFactor = useCreateTotpFactor();\n\n const handleVerified = async () => {\n await createAuthFactor.mutateAsync(undefined);\n };\n\n const onTriggerClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (elevatedAccess && !createAuthFactor.data) {\n event.preventDefault();\n setManuallyTriggered(true);\n createAuthFactor.mutate(undefined, {\n onSuccess: () => {\n setOpen(true);\n },\n });\n } else {\n setManuallyTriggered(false);\n }\n };\n\n const handleClose = React.useCallback(() => {\n setOpen(false);\n }, []);\n\n return (\n <Dialog.Root\n {...props}\n open={props.open || open}\n onOpenChange={props.onOpenChange || setOpen}\n >\n <Dialog.Trigger\n onClick={onTriggerClick}\n // @ts-ignore I've to find a way to pass the loading state to the trigger\n loading={manuallyTriggered && createAuthFactor.isPending}\n >\n {children}\n </Dialog.Trigger>\n\n <Dialog.Content maxWidth=\"480px\">\n <ElevatedAccess onVerified={handleVerified}>\n <Content onClose={handleClose} totpFactor={createAuthFactor.data} />\n </ElevatedAccess>\n </Dialog.Content>\n </Dialog.Root>\n );\n}\n\ninterface ContentProps {\n totpFactor?: CreateTotpFactorResponse;\n onClose?: () => void;\n}\n\nfunction Content({ onClose, totpFactor }: ContentProps) {\n const securitySettings = useSecuritySettings();\n const translate = useTranslation();\n\n const [customError, setCustomError] = React.useState<string | null>(null);\n const totp = hasQrCode(totpFactor)\n ? totpFactor.authenticationFactor.totp\n : undefined;\n\n const verifyTotp = useVerifyTotpFactor({\n mutation: {\n onSuccess: ({ success }) => {\n if (!success) {\n setCustomError(\"Invalid passcode\");\n }\n },\n },\n });\n\n const serverError = verifyTotp.error || customError;\n const isSuccess = verifyTotp.isSuccess && !serverError;\n\n const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n setCustomError(null);\n\n const formData = new FormData(event.currentTarget);\n const otpCode = formData.get(\"otp-code\")?.toString();\n\n verifyTotp.mutate({\n data: {\n authenticationChallengeId: totpFactor?.authenticationChallenge.id ?? \"\",\n code: otpCode ?? \"\",\n },\n });\n };\n\n useDialogClose(isSuccess, () => {\n securitySettings.update(\"Mfa\", true);\n });\n\n return (\n <>\n <Dialog.Title mb=\"5\">\n <Translation\n defaultMessage=\"Set up an authenticator app\"\n id=\"Eu+kuO\"\n description=\"Title for setting up two-factor authentication\"\n />\n </Dialog.Title>\n\n <Form.Root onSubmit={handleSubmit}>\n <Grid columns=\"auto 1fr\" rows=\"repeat(4, auto)\" gapX=\"3\" gapY=\"1\">\n <Grid\n rows=\"subgrid\"\n gridRow=\"span 4\"\n style={{ placeItems: \"center\" }}\n >\n {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}\n <Marker>1</Marker>\n <Separator\n orientation=\"vertical\"\n size=\"4\"\n style={{ width: \"2px\" }}\n />\n {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}\n <Marker>2</Marker>\n <div />\n </Grid>\n\n <Grid rows=\"subgrid\" gridRow=\"span 4\">\n <Text as=\"p\" size=\"3\" weight=\"bold\">\n <Translation\n defaultMessage=\"Scan the QR code\"\n id=\"fTSp5u\"\n description=\"Heading for the QR code scanning step in MFA setup\"\n />\n </Text>\n <Flex direction=\"column\" gap=\"1\">\n <Text as=\"p\" size=\"2\">\n <Translation\n defaultMessage=\"Use an authenticator app like {onep}, {google}, {authy}, or {microsoft} to scan the QR code below.\"\n id=\"8xwdwI\"\n description=\"Instructions for scanning the QR code with authenticator apps\"\n values={{\n onep: (\n <Link\n href=\"https://1password.com/\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n // eslint-disable-next-line formatjs/no-literal-string-in-jsx\n >\n 1Password\n </Link>\n ),\n google: (\n <Link\n href=\"https://apps.apple.com/us/app/google-authenticator/id388497605\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n // eslint-disable-next-line formatjs/no-literal-string-in-jsx\n >\n Google Authenticator\n </Link>\n ),\n authy: (\n <Link\n href=\"https://authy.com/\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n // eslint-disable-next-line formatjs/no-literal-string-in-jsx\n >\n Authy\n </Link>\n ),\n microsoft: (\n <Link\n href=\"https://www.microsoft.com/en-gb/security/mobile-authenticator-app\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n // eslint-disable-next-line formatjs/no-literal-string-in-jsx\n >\n Microsoft Authenticator\n </Link>\n ),\n }}\n />\n </Text>\n <Flex align=\"center\" gap=\"5\" my=\"5\">\n <Grid\n position=\"relative\"\n width=\"160px\"\n height=\"160px\"\n p=\"2\"\n style={{\n border: \"1px solid var(--gray-7)\",\n borderRadius: \"var(--radius-4)\",\n background: \"var(--gray-2)\",\n overflow: \"hidden\",\n }}\n >\n {totp?.qr_code && (\n <Box asChild width=\"100%\" height=\"auto\">\n <img\n alt={translate({\n defaultMessage: \"Scan this QR code to enroll\",\n description: \"Alt text for QR code image\",\n id: \"wpbqFJ\",\n })}\n aria-describedby=\"secret-note\"\n height=\"160\"\n src={totp.qr_code}\n style={{ userSelect: \"none\", background: \"white\" }}\n width=\"160\"\n />\n </Box>\n )}\n </Grid>\n\n <Flex direction=\"column\" gap=\"1\" align=\"start\">\n <Text color=\"gray\" id=\"secret-note\" size=\"2\">\n <Translation\n defaultMessage=\"Can't scan the code?\"\n id=\"6/cdcS\"\n description=\"Question asking if user is unable to scan the QR code\"\n />\n </Text>\n\n <SecretDialog setupKey={totp?.secret ?? \"\"}>\n <Button\n variant=\"secondary\"\n size=\"1\"\n disabled={verifyTotp.isPending || isSuccess}\n >\n <Translation\n defaultMessage=\"View setup key\"\n id=\"q3eZjH\"\n description=\"Button text to view the manual setup key\"\n />\n </Button>\n </SecretDialog>\n </Flex>\n </Flex>\n </Flex>\n <Text as=\"p\" size=\"3\" weight=\"bold\">\n <Translation\n defaultMessage=\"Get verification passcode\"\n id=\"1kRd2b\"\n description=\"Heading for entering the verification code step\"\n />\n </Text>\n <Flex direction=\"column\" gap=\"4\">\n <Text as=\"p\" size=\"2\">\n <Translation\n defaultMessage=\"Enter the 6-digit passcode from your authenticator app.\"\n id=\"4/66bS\"\n description=\"Instructions for entering the verification passcode\"\n />\n </Text>\n\n <Flex direction=\"column\" gap=\"2\">\n <Otp.Root\n autoSubmit\n gap=\"3\"\n justify=\"start\"\n name=\"otp-code\"\n rows=\"48px\"\n columns=\"repeat(6, 48px)\"\n readOnly={verifyTotp.isPending || isSuccess}\n >\n <Otp.Input required autoFocus autoComplete=\"off\" />\n <Otp.Input required />\n <Otp.Input required />\n <Otp.Input required />\n <Otp.Input required />\n <Otp.Input required />\n </Otp.Root>\n\n {serverError && (\n <Text size=\"2\" color=\"red\">\n {getMutationErrorMessage(serverError)}\n </Text>\n )}\n </Flex>\n </Flex>\n </Grid>\n </Grid>\n\n <Flex mt=\"5\" gap=\"3\" justify=\"end\">\n <Dialog.Close>\n <Button\n variant=\"secondary\"\n disabled={verifyTotp.isPending || isSuccess}\n >\n <Translation\n defaultMessage=\"Cancel\"\n id=\"84pAvU\"\n description=\"Button text to cancel MFA setup\"\n />\n </Button>\n </Dialog.Close>\n\n <SaveButton\n type=\"submit\"\n loading={verifyTotp.isPending}\n done={isSuccess}\n onDone={onClose}\n >\n <Translation\n defaultMessage=\"Confirm\"\n id=\"WHthZi\"\n description=\"Button text to confirm MFA setup\"\n />\n </SaveButton>\n </Flex>\n </Form.Root>\n\n {/* mirror errors in a live region */}\n <VisuallyHidden asChild>\n <section aria-live=\"polite\">\n {getMutationErrorMessage(serverError)}\n </section>\n </VisuallyHidden>\n </>\n );\n}\n\ninterface SecretDialogProps extends React.PropsWithChildren {\n setupKey: string;\n}\n\nfunction SecretDialog({ children, setupKey }: SecretDialogProps) {\n return (\n <Dialog.Root>\n <Dialog.Trigger>{children}</Dialog.Trigger>\n <Dialog.Content\n maxWidth=\"90vw\"\n size={{ initial: \"3\", sm: \"4\" }}\n minWidth=\"300px\"\n width=\"fit-content\"\n >\n <Dialog.Title size=\"2\" weight=\"regular\">\n <Translation\n defaultMessage=\"Your setup key\"\n id=\"LleqNP\"\n description=\"Title for dialog showing the manual setup key\"\n />\n </Dialog.Title>\n <Dialog.Description>\n <Text size=\"6\">\n <Code variant=\"ghost\" style={{ letterSpacing: \"0.15rem\" }}>\n {setupKey}\n </Code>\n </Text>\n </Dialog.Description>\n\n <Flex align=\"center\" gap=\"3\" justify=\"end\" mt=\"5\">\n <Dialog.Close>\n <CopyButton value={setupKey}>\n <Translation\n defaultMessage=\"Copy and close\"\n id=\"EyjGir\"\n description=\"Button text to copy setup key and close dialog\"\n />\n </CopyButton>\n </Dialog.Close>\n </Flex>\n </Dialog.Content>\n </Dialog.Root>\n );\n}\n\nfunction getMutationErrorMessage(error: unknown) {\n let message = \"Something went wrong, please try again\";\n\n if (typeof error === \"string\") {\n message = error;\n }\n\n if (error instanceof Error) {\n message = error.message;\n }\n\n if (\n typeof error === \"object\" &&\n error !== null &&\n \"message\" in error &&\n typeof error.message === \"string\"\n ) {\n message = error.message;\n }\n\n if (message === \"Invalid passcode\") {\n message = \"Invalid passcode, please try again\";\n }\n\n return message;\n}\n\nfunction hasQrCode(\n response?: CreateTotpFactorResponse,\n): response is CreateTotpFactorResponse & {\n authenticationFactor: {\n totp: NonNullable<CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOf>;\n };\n} {\n const totp = response?.authenticationFactor.totp;\n return totp != null && \"qr_code\" in totp;\n}\n"],"mappings":";AAuEI,SAqEA,UAhEE,KALF;AArEJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,YAAY,WAAW;AAEvB,YAAY,SAAS;AACrB,SAAS,QAAQ,cAAc;AAC/B;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AACP,SAAS,8BAA8B;AACvC,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAOxB,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,QAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAC5C,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,MAAM,SAAS,KAAK;AACtE,QAAM,EAAE,eAAe,IAAI,uBAAuB;AAClD,QAAM,mBAAmB,oBAAoB;AAE7C,QAAM,iBAAiB,YAAY;AACjC,UAAM,iBAAiB,YAAY,MAAS;AAAA,EAC9C;AAEA,QAAM,iBAAiB,CAAC,UAA+C;AACrE,QAAI,kBAAkB,CAAC,iBAAiB,MAAM;AAC5C,YAAM,eAA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QAEN;AAAA,8BAAC,OAAO,OAAP,EAAa,MAAK,KAAI,QAAO,WAC5B;AAAA,YAAC;AAAA;AAAA,cACC,gBAAe;AAAA,cACf,IAAG;AAAA,cACH,aAAY;AAAA;AAAA,UACd,GACF;AAAA,UACA,oBAAC,OAAO,aAAP,EACC,8BAAC,QAAK,MAAK,KACT,8BAAC,QAAK,SAAQ,SAAQ,OAAO,EAAE,eAAe,UAAU,GACrD,oBACH,GACF,GACF;AAAA,UAEA,oBAAC,QAAK,OAAM,UAAS,KAAI,KAAI,SAAQ,OAAM,IAAG,KAC5C,8BAAC,OAAO,OAAP,EACC,8BAAC,cAAW,OAAO,UACjB;AAAA,YAAC;AAAA;AAAA,cACC,gBAAe;AAAA,cACf,IAAG;AAAA,cACH,aAAY;AAAA;AAAA,UACd,GACF,GACF,GACF;AAAA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,SAAS,wBAAwB,OAAgB;AAC/C,MAAI,UAAU;AAEd,MAAI,OAAO,UAAU,UAAU;AAC7B,cAAU;AAAA,EACZ;AAEA,MAAI,iBAAiB,OAAO;AAC1B,cAAU,MAAM;AAAA,EAClB;AAEA,MACE,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACb,OAAO,MAAM,YAAY,UACzB;AACA,cAAU,MAAM;AAAA,EAClB;AAEA,MAAI,YAAY,oBAAoB;AAClC,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;AAEA,SAAS,UACP,UAKA;AACA,QAAM,OAAO,UAAU,qBAAqB;AAC5C,SAAO,QAAQ,QAAQ,aAAa;AACtC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/admin-portal-domain-verification.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Box, Card, Flex, Text } from \"@radix-ui/themes\";\nimport { Skeleton, Button } from \"./elements.js\";\nimport { IconPanel } from \"./icon-panel.js\";\nimport { GenericError } from \"./generic-error.js\";\nimport { ExternalLinkIcon } from \"@radix-ui/react-icons\";\nimport * as CardList from \"./card-list.js\";\nimport { OrganizationDomain } from \"../api/endpoint.js\";\nimport { DomainItem } from \"./domain-item.js\";\nimport { getDomProps } from \"./utils.js\";\nimport type { WidgetRootDomProps, WidgetRootState } from \"./utils.js\";\nimport { Translation } from \"./i18n/translation.js\";\n\ninterface AdminPortalDomainVerificationProps extends WidgetRootDomProps {\n organizationDomains: OrganizationDomain[];\n onAddDomain: () => void;\n onDeleteDomain: (domainId: string) => void;\n onReverifyDomain: (domainId: string) => void;\n isPending?: boolean;\n}\n\nconst AdminPortalDomainVerification = ({\n organizationDomains,\n onAddDomain,\n onDeleteDomain,\n onReverifyDomain,\n isPending = false,\n ...domProps\n}: AdminPortalDomainVerificationProps) => {\n if (organizationDomains.length === 0) {\n return (\n <Card size=\"2\" {...getWidgetRootDomProps(\"resolved\", domProps)}>\n <Flex direction=\"row\" justify=\"between\" align=\"center\">\n <Text size=\"2\" color=\"gray\">\n <Translation\n defaultMessage=\"You haven't added any verified domains yet.\"\n id=\"t/D0Sf\"\n description=\"Empty state message when no domains have been added\"\n />\n </Text>\n <Button\n variant=\"secondary\"\n loading={isPending}\n disabled={isPending}\n onClick={onAddDomain}\n >\n <Translation\n defaultMessage=\"Add domain\"\n id=\"APksY2\"\n description=\"Button text to add a new domain\"\n />\n <ExternalLinkIcon aria-hidden />\n </Button>\n </Flex>\n </Card>\n );\n }\n\n return (\n <Flex\n direction=\"column\"\n gap=\"4\"\n {...getWidgetRootDomProps(\"resolved\", domProps)}\n >\n <CardList.Root>\n {organizationDomains.map((domain) => (\n <CardList.Item key={domain.id}>\n <DomainItem\n domain={domain}\n onDeleteDomain={onDeleteDomain}\n onReverifyDomain={onReverifyDomain}\n />\n </CardList.Item>\n ))}\n </CardList.Root>\n\n <Box>\n <Button\n variant=\"secondary\"\n loading={isPending}\n disabled={isPending}\n onClick={onAddDomain}\n >\n <Translation\n defaultMessage=\"Add domain\"\n id=\"APksY2\"\n description=\"Button text to add a new domain\"\n />\n <ExternalLinkIcon aria-hidden />\n </Button>\n </Box>\n </Flex>\n );\n};\n\ninterface AdminPortalDomainVerificationLoadingProps
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/admin-portal-domain-verification.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Box, Card, Flex, Text } from \"@radix-ui/themes\";\nimport { Skeleton, Button } from \"./elements.js\";\nimport { IconPanel } from \"./icon-panel.js\";\nimport { GenericError } from \"./generic-error.js\";\nimport { ExternalLinkIcon } from \"@radix-ui/react-icons\";\nimport * as CardList from \"./card-list.js\";\nimport { OrganizationDomain } from \"../api/endpoint.js\";\nimport { DomainItem } from \"./domain-item.js\";\nimport { getDomProps } from \"./utils.js\";\nimport type { WidgetRootDomProps, WidgetRootState } from \"./utils.js\";\nimport { Translation } from \"./i18n/translation.js\";\n\ninterface AdminPortalDomainVerificationProps extends WidgetRootDomProps {\n organizationDomains: OrganizationDomain[];\n onAddDomain: () => void;\n onDeleteDomain: (domainId: string) => void;\n onReverifyDomain: (domainId: string) => void;\n isPending?: boolean;\n}\n\nconst AdminPortalDomainVerification = ({\n organizationDomains,\n onAddDomain,\n onDeleteDomain,\n onReverifyDomain,\n isPending = false,\n ...domProps\n}: AdminPortalDomainVerificationProps) => {\n if (organizationDomains.length === 0) {\n return (\n <Card size=\"2\" {...getWidgetRootDomProps(\"resolved\", domProps)}>\n <Flex direction=\"row\" justify=\"between\" align=\"center\">\n <Text size=\"2\" color=\"gray\">\n <Translation\n defaultMessage=\"You haven't added any verified domains yet.\"\n id=\"t/D0Sf\"\n description=\"Empty state message when no domains have been added\"\n />\n </Text>\n <Button\n variant=\"secondary\"\n loading={isPending}\n disabled={isPending}\n onClick={onAddDomain}\n >\n <Translation\n defaultMessage=\"Add domain\"\n id=\"APksY2\"\n description=\"Button text to add a new domain\"\n />\n <ExternalLinkIcon aria-hidden />\n </Button>\n </Flex>\n </Card>\n );\n }\n\n return (\n <Flex\n direction=\"column\"\n gap=\"4\"\n {...getWidgetRootDomProps(\"resolved\", domProps)}\n >\n <CardList.Root>\n {organizationDomains.map((domain) => (\n <CardList.Item key={domain.id}>\n <DomainItem\n domain={domain}\n onDeleteDomain={onDeleteDomain}\n onReverifyDomain={onReverifyDomain}\n />\n </CardList.Item>\n ))}\n </CardList.Root>\n\n <Box>\n <Button\n variant=\"secondary\"\n loading={isPending}\n disabled={isPending}\n onClick={onAddDomain}\n >\n <Translation\n defaultMessage=\"Add domain\"\n id=\"APksY2\"\n description=\"Button text to add a new domain\"\n />\n <ExternalLinkIcon aria-hidden />\n </Button>\n </Box>\n </Flex>\n );\n};\n\ninterface AdminPortalDomainVerificationLoadingProps extends WidgetRootDomProps {}\n\nconst AdminPortalDomainVerificationLoading: React.FC<\n AdminPortalDomainVerificationLoadingProps\n> = (domProps) => {\n return (\n <Card size=\"2\" {...getWidgetRootDomProps(\"loading\", domProps)}>\n <Flex gap=\"4\" align=\"center\">\n <Skeleton>\n <IconPanel />\n </Skeleton>\n\n <Flex direction=\"column\">\n <Text size=\"2\" highContrast weight=\"bold\" as=\"p\" mb=\"-2px\">\n <Skeleton>\n <Translation\n defaultMessage=\"Domain name\"\n id=\"O2vxRJ\"\n description=\"Placeholder text for domain name loading state\"\n />\n </Skeleton>\n </Text>\n\n <Text size=\"2\" color=\"gray\" as=\"p\">\n <Skeleton>\n <Translation\n defaultMessage=\"Added recently\"\n id=\"w3A6MN\"\n description=\"Placeholder text for domain added date loading state\"\n />\n </Skeleton>\n </Text>\n </Flex>\n </Flex>\n </Card>\n );\n};\n\ninterface AdminPortalDomainVerificationErrorProps extends WidgetRootDomProps {\n error: unknown;\n}\n\nconst AdminPortalDomainVerificationError: React.FC<\n AdminPortalDomainVerificationErrorProps\n> = ({ 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: \"admin-portal-domain-verification\",\n widgetState: state,\n });\n}\n\nexport type {\n AdminPortalDomainVerificationProps,\n AdminPortalDomainVerificationLoadingProps,\n AdminPortalDomainVerificationErrorProps,\n};\nexport {\n AdminPortalDomainVerification,\n AdminPortalDomainVerificationLoading,\n AdminPortalDomainVerificationError,\n};\n"],"mappings":";AAoCY,cAMF,YANE;AAjCZ,SAAS,KAAK,MAAM,MAAM,YAAY;AACtC,SAAS,UAAU,cAAc;AACjC,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,YAAY,cAAc;AAE1B,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAE5B,SAAS,mBAAmB;AAU5B,MAAM,gCAAgC,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,GAAG;AACL,MAA0C;AACxC,MAAI,oBAAoB,WAAW,GAAG;AACpC,WACE,oBAAC,QAAK,MAAK,KAAK,GAAG,sBAAsB,YAAY,QAAQ,GAC3D,+BAAC,QAAK,WAAU,OAAM,SAAQ,WAAU,OAAM,UAC5C;AAAA,0BAAC,QAAK,MAAK,KAAI,OAAM,QACnB;AAAA,QAAC;AAAA;AAAA,UACC,gBAAe;AAAA,UACf,IAAG;AAAA,UACH,aAAY;AAAA;AAAA,MACd,GACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,SAAS;AAAA,UACT,UAAU;AAAA,UACV,SAAS;AAAA,UAET;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,gBAAe;AAAA,gBACf,IAAG;AAAA,gBACH,aAAY;AAAA;AAAA,YACd;AAAA,YACA,oBAAC,oBAAiB,eAAW,MAAC;AAAA;AAAA;AAAA,MAChC;AAAA,OACF,GACF;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,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