@wacht/jsx 0.0.1-alpha.6 → 0.0.1-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/index.d.ts +1311 -5
  2. package/package.json +1 -1
  3. package/dist/components/agent/agent-conversation-history.d.ts +0 -5
  4. package/dist/components/agent/agent-conversation-hub.d.ts +0 -1
  5. package/dist/components/agent/agent-conversation.d.ts +0 -5
  6. package/dist/components/agent/index.d.ts +0 -3
  7. package/dist/components/agent/user-input-request.d.ts +0 -7
  8. package/dist/components/auth/accept-invite.d.ts +0 -7
  9. package/dist/components/auth/auth-image.d.ts +0 -1
  10. package/dist/components/auth/forgot-password.d.ts +0 -5
  11. package/dist/components/auth/index.d.ts +0 -13
  12. package/dist/components/auth/magic-link-verification.d.ts +0 -6
  13. package/dist/components/auth/other-auth-options.d.ts +0 -1
  14. package/dist/components/auth/other-signin-options.d.ts +0 -5
  15. package/dist/components/auth/phone-verification.d.ts +0 -7
  16. package/dist/components/auth/profile-completion.d.ts +0 -2
  17. package/dist/components/auth/signin-form.d.ts +0 -1
  18. package/dist/components/auth/signup-form.d.ts +0 -1
  19. package/dist/components/auth/social-buttons.d.ts +0 -7
  20. package/dist/components/auth/sso-callback.d.ts +0 -2
  21. package/dist/components/auth/two-factor-method-selector.d.ts +0 -15
  22. package/dist/components/auth/two-factor-verification.d.ts +0 -2
  23. package/dist/components/auth/waitlist-form.d.ts +0 -1
  24. package/dist/components/control/index.d.ts +0 -5
  25. package/dist/components/control/navigation.d.ts +0 -2
  26. package/dist/components/control/require-active-tenancy.d.ts +0 -5
  27. package/dist/components/control/signed-in-accounts.d.ts +0 -6
  28. package/dist/components/control/signed-in.d.ts +0 -5
  29. package/dist/components/control/signed-out.d.ts +0 -5
  30. package/dist/components/control/user-selection.d.ts +0 -0
  31. package/dist/components/deployment-instance.d.ts +0 -7
  32. package/dist/components/icons/apple.d.ts +0 -1
  33. package/dist/components/icons/brave.d.ts +0 -1
  34. package/dist/components/icons/chevron-right.d.ts +0 -1
  35. package/dist/components/icons/chrome.d.ts +0 -2
  36. package/dist/components/icons/discord.d.ts +0 -1
  37. package/dist/components/icons/edge.d.ts +0 -2
  38. package/dist/components/icons/facebook.d.ts +0 -1
  39. package/dist/components/icons/firefox.d.ts +0 -2
  40. package/dist/components/icons/github.d.ts +0 -1
  41. package/dist/components/icons/gitlab.d.ts +0 -1
  42. package/dist/components/icons/google.d.ts +0 -1
  43. package/dist/components/icons/key.d.ts +0 -1
  44. package/dist/components/icons/linkedin.d.ts +0 -1
  45. package/dist/components/icons/microsoft.d.ts +0 -1
  46. package/dist/components/icons/opera.d.ts +0 -1
  47. package/dist/components/icons/safari.d.ts +0 -2
  48. package/dist/components/icons/shield.d.ts +0 -1
  49. package/dist/components/icons/smartphone.d.ts +0 -1
  50. package/dist/components/icons/x.d.ts +0 -1
  51. package/dist/components/index.d.ts +0 -17
  52. package/dist/components/notifications/channel-selector.d.ts +0 -8
  53. package/dist/components/notifications/index.d.ts +0 -4
  54. package/dist/components/notifications/notification-bell.d.ts +0 -9
  55. package/dist/components/notifications/notification-item.d.ts +0 -8
  56. package/dist/components/notifications/notification-popover.d.ts +0 -16
  57. package/dist/components/organization/add-domain-popover.d.ts +0 -8
  58. package/dist/components/organization/add-role-popover.d.ts +0 -14
  59. package/dist/components/organization/context.d.ts +0 -9
  60. package/dist/components/organization/create-organization-dialog.d.ts +0 -8
  61. package/dist/components/organization/create-organization-form.d.ts +0 -6
  62. package/dist/components/organization/index.d.ts +0 -3
  63. package/dist/components/organization/invite-member-popover.d.ts +0 -9
  64. package/dist/components/organization/manage-organization-dialog.d.ts +0 -14
  65. package/dist/components/organization/manage-organization.d.ts +0 -1
  66. package/dist/components/organization/organization-selector-menu.d.ts +0 -7
  67. package/dist/components/organization/organization-switcher.d.ts +0 -5
  68. package/dist/components/user/2fa-styles.d.ts +0 -56
  69. package/dist/components/user/2fa.d.ts +0 -20
  70. package/dist/components/user/add-email-popover.d.ts +0 -10
  71. package/dist/components/user/add-phone-popover.d.ts +0 -10
  72. package/dist/components/user/backup-codes-popover.d.ts +0 -9
  73. package/dist/components/user/change-password-popover.d.ts +0 -8
  74. package/dist/components/user/context.d.ts +0 -9
  75. package/dist/components/user/index.d.ts +0 -4
  76. package/dist/components/user/manage-account-dialog.d.ts +0 -14
  77. package/dist/components/user/manage-account.d.ts +0 -2
  78. package/dist/components/user/remove-password-popover.d.ts +0 -7
  79. package/dist/components/user/setup-totp-popover.d.ts +0 -12
  80. package/dist/components/user/user-button.d.ts +0 -6
  81. package/dist/components/user/user-controls.d.ts +0 -7
  82. package/dist/components/utility/button.d.ts +0 -7
  83. package/dist/components/utility/combo-box.d.ts +0 -39
  84. package/dist/components/utility/confirmation-popover.d.ts +0 -7
  85. package/dist/components/utility/dialog.d.ts +0 -49
  86. package/dist/components/utility/dropdown.d.ts +0 -20
  87. package/dist/components/utility/empty-state.d.ts +0 -8
  88. package/dist/components/utility/form.d.ts +0 -3
  89. package/dist/components/utility/index.d.ts +0 -14
  90. package/dist/components/utility/input.d.ts +0 -1
  91. package/dist/components/utility/loader.d.ts +0 -7
  92. package/dist/components/utility/navigation.d.ts +0 -8
  93. package/dist/components/utility/otp-input.d.ts +0 -9
  94. package/dist/components/utility/phone.d.ts +0 -7
  95. package/dist/components/utility/root.d.ts +0 -1
  96. package/dist/components/utility/search.d.ts +0 -7
  97. package/dist/components/utility/spinner.d.ts +0 -6
  98. package/dist/components/utility/switch.d.ts +0 -7
  99. package/dist/components/utility/table.d.ts +0 -8
  100. package/dist/components/utility/tabs.d.ts +0 -34
  101. package/dist/components/utility/use-dialog.d.ts +0 -12
  102. package/dist/components/workspace/add-role-popover.d.ts +0 -13
  103. package/dist/components/workspace/create-workspace-dialog.d.ts +0 -9
  104. package/dist/components/workspace/create-workspace-form.d.ts +0 -9
  105. package/dist/components/workspace/index.d.ts +0 -4
  106. package/dist/components/workspace/invite-member-popover.d.ts +0 -10
  107. package/dist/components/workspace/manage-workspace-dialog.d.ts +0 -14
  108. package/dist/components/workspace/manage-workspace.d.ts +0 -1
  109. package/dist/constants/ai-agent.d.ts +0 -43
  110. package/dist/constants/execution-status.d.ts +0 -38
  111. package/dist/constants/geo.d.ts +0 -8
  112. package/dist/context/agent-conversation-provider.d.ts +0 -37
  113. package/dist/context/deployment-provider.d.ts +0 -10
  114. package/dist/context/index.d.ts +0 -2
  115. package/dist/context/signin-provider.d.ts +0 -21
  116. package/dist/hooks/index.d.ts +0 -22
  117. package/dist/hooks/use-agent-conversation.d.ts +0 -61
  118. package/dist/hooks/use-channel-counts.d.ts +0 -14
  119. package/dist/hooks/use-client.d.ts +0 -7
  120. package/dist/hooks/use-context-manager.d.ts +0 -30
  121. package/dist/hooks/use-conversation-sessions.d.ts +0 -32
  122. package/dist/hooks/use-deployment.d.ts +0 -1
  123. package/dist/hooks/use-forgot-password.d.ts +0 -10
  124. package/dist/hooks/use-invitation.d.ts +0 -23
  125. package/dist/hooks/use-magic-link.d.ts +0 -14
  126. package/dist/hooks/use-navigation.d.ts +0 -6
  127. package/dist/hooks/use-notification-stream.d.ts +0 -27
  128. package/dist/hooks/use-notifications.d.ts +0 -30
  129. package/dist/hooks/use-organization.d.ts +0 -81
  130. package/dist/hooks/use-session.d.ts +0 -27
  131. package/dist/hooks/use-signin.d.ts +0 -132
  132. package/dist/hooks/use-signup.d.ts +0 -46
  133. package/dist/hooks/use-sso-callback.d.ts +0 -15
  134. package/dist/hooks/use-user.d.ts +0 -83
  135. package/dist/hooks/use-waitlist.d.ts +0 -24
  136. package/dist/hooks/use-workspace.d.ts +0 -50
  137. package/dist/models/websocket.d.ts +0 -25
  138. package/dist/services/websocket-manager.d.ts +0 -46
  139. package/dist/types/deployment-context.d.ts +0 -7
  140. package/dist/types/index.d.ts +0 -4
  141. package/dist/types/notification.d.ts +0 -51
  142. package/dist/types/platform-adapter.d.ts +0 -10
  143. package/dist/utils/event-emitter.d.ts +0 -9
  144. package/dist/utils/navigation.d.ts +0 -2
  145. package/dist/utils/profile-completion.d.ts +0 -3
  146. package/dist/utils/response-mapper.d.ts +0 -2
@@ -1,61 +0,0 @@
1
- import { CONNECTION_STATES } from '../constants/ai-agent';
2
- import { FrontendStatus } from '../constants/execution-status';
3
- export interface UserInputRequest {
4
- question: string;
5
- context: string;
6
- input_type: "text" | "number" | "select" | "multiselect" | "boolean" | "date";
7
- options?: string[];
8
- default_value?: string;
9
- placeholder?: string;
10
- }
11
- export interface ImageData {
12
- mime_type: string;
13
- data?: string;
14
- url?: string;
15
- }
16
- export interface ConversationMessage {
17
- id: string | number;
18
- role: "user" | "assistant" | "system";
19
- content: string;
20
- timestamp: Date;
21
- isStreaming?: boolean;
22
- images?: ImageData[];
23
- metadata?: {
24
- type?: "user_input_request" | "log";
25
- userInputRequest?: UserInputRequest;
26
- messageType?: string;
27
- };
28
- }
29
- interface UseAgentConversationProps {
30
- contextId: string;
31
- agentName: string;
32
- token: string;
33
- platformAdapter?: {
34
- onPlatformEvent?: (eventName: string, eventData: unknown) => void;
35
- onPlatformFunction?: (functionName: string, parameters: unknown, executionId: string) => Promise<unknown>;
36
- };
37
- onUserInputRequest?: (request: UserInputRequest) => Promise<string>;
38
- autoConnect?: boolean;
39
- }
40
- export declare function useAgentConversation({ contextId, agentName, token, platformAdapter, autoConnect, }: UseAgentConversationProps): {
41
- messages: ConversationMessage[];
42
- pendingMessage: string | null;
43
- pendingImages: ImageData[] | null;
44
- connectionState: {
45
- status: (typeof CONNECTION_STATES)[keyof typeof CONNECTION_STATES];
46
- };
47
- isConnected: boolean;
48
- isExecuting: boolean;
49
- executionStatus: FrontendStatus;
50
- isWaitingForInput: boolean;
51
- hasMoreMessages: boolean;
52
- isLoadingMore: boolean;
53
- sendMessage: (content: string, images?: ImageData[]) => void;
54
- submitUserInput: (value: string) => void;
55
- clearMessages: () => void;
56
- loadMoreMessages: () => Promise<void>;
57
- cancelExecution: () => void;
58
- connect: () => Promise<() => void>;
59
- disconnect: () => void;
60
- };
61
- export {};
@@ -1,14 +0,0 @@
1
- import { ChannelCounts } from '../../../../../../../../lib/types/notification';
2
- type UseChannelCountsReturnType = {
3
- loading: true;
4
- counts: never;
5
- error: Error | null;
6
- refetch: () => Promise<void>;
7
- } | {
8
- loading: false;
9
- counts: ChannelCounts;
10
- error: Error | null;
11
- refetch: () => Promise<void>;
12
- };
13
- export declare function useChannelCounts(): UseChannelCountsReturnType;
14
- export {};
@@ -1,7 +0,0 @@
1
- import { Client } from '../../../../../../../../lib/types';
2
- type UseClientReturnType = {
3
- client: Client;
4
- loading: boolean;
5
- };
6
- export declare function useClient(): UseClientReturnType;
7
- export {};
@@ -1,30 +0,0 @@
1
- export interface ExecutionContext {
2
- id: string;
3
- title: string;
4
- status: 'idle' | 'running' | 'waiting_for_input' | 'interrupted' | 'completed' | 'failed';
5
- last_activity_at: string;
6
- context_group?: string;
7
- created_at: string;
8
- }
9
- export interface CreateContextRequest {
10
- title: string;
11
- }
12
- export interface ListContextsOptions {
13
- limit?: number;
14
- offset?: number;
15
- status?: string;
16
- }
17
- export interface ListContextsResponse {
18
- data: ExecutionContext[];
19
- has_more: boolean;
20
- }
21
- type UseContextManagerReturnType = {
22
- contexts: ExecutionContext[];
23
- loading: boolean;
24
- error: Error | null;
25
- createContext: (request: CreateContextRequest) => Promise<ExecutionContext>;
26
- deleteContext: (id: string) => Promise<void>;
27
- refetch: () => Promise<void>;
28
- };
29
- export declare function useContextManager(token: string): UseContextManagerReturnType;
30
- export {};
@@ -1,32 +0,0 @@
1
- export interface ConversationSession {
2
- id: string;
3
- title: string;
4
- status: 'idle' | 'running' | 'waiting_for_input' | 'interrupted' | 'completed' | 'failed';
5
- last_activity_at: string;
6
- context_group?: string;
7
- created_at: string;
8
- }
9
- export interface CreateSessionRequest {
10
- title: string;
11
- system_instructions?: string;
12
- }
13
- export interface ListSessionsOptions {
14
- limit?: number;
15
- offset?: number;
16
- status?: string;
17
- search?: string;
18
- }
19
- export interface ListSessionsResponse {
20
- data: ConversationSession[];
21
- has_more: boolean;
22
- }
23
- type UseConversationSessionsReturnType = {
24
- sessions: ConversationSession[];
25
- loading: boolean;
26
- error: Error | null;
27
- createSession: (request: CreateSessionRequest) => Promise<ConversationSession>;
28
- deleteSession: (id: string) => Promise<void>;
29
- refetch: () => Promise<void>;
30
- };
31
- export declare function useConversationSessions(token: string): UseConversationSessionsReturnType;
32
- export {};
@@ -1 +0,0 @@
1
- export declare function useDeployment(): import('..').DeploymentContextType;
@@ -1,10 +0,0 @@
1
- import { ApiResult, ErrorInterface, Session } from '../../../../../../../../lib/types';
2
- export declare function useForgotPassword(): {
3
- error: Error | null;
4
- loading: boolean;
5
- forgotPassword: (email: string) => Promise<ApiResult<{}, ErrorInterface>>;
6
- verifyOtp: (email: string, otp: string) => Promise<ApiResult<{
7
- token: string;
8
- }, ErrorInterface>>;
9
- resetPassword: (token: string, password: string) => Promise<ApiResult<Session, ErrorInterface>>;
10
- };
@@ -1,23 +0,0 @@
1
- export interface AcceptInvitationResponse {
2
- organization?: {
3
- id: string;
4
- name: string;
5
- };
6
- workspace?: {
7
- id: string;
8
- name: string;
9
- };
10
- signin_id?: string;
11
- already_member?: boolean;
12
- message?: string;
13
- requires_signin?: boolean;
14
- invited_email?: string;
15
- error_code?: string;
16
- }
17
- export declare const useInvitation: () => {
18
- acceptInvitation: (token: string) => Promise<AcceptInvitationResponse>;
19
- invitationData: AcceptInvitationResponse | null;
20
- loading: boolean;
21
- error: string | null;
22
- reset: () => void;
23
- };
@@ -1,14 +0,0 @@
1
- import { ApiResult, ErrorInterface } from '../../../../../../../../lib/types';
2
- export interface MagicLinkParams {
3
- token?: string;
4
- attempt?: string;
5
- redirectUri?: string;
6
- }
7
- export interface UseMagicLinkVerificationReturnType {
8
- loading: boolean;
9
- verifyMagicLink: (params: MagicLinkParams) => Promise<ApiResult<{}, ErrorInterface>>;
10
- error: Error | null;
11
- success: boolean | null;
12
- }
13
- export declare function useMagicLinkVerification(): UseMagicLinkVerificationReturnType;
14
- export declare function useMagicLinkParams(): MagicLinkParams;
@@ -1,6 +0,0 @@
1
- import { NavigateOptions } from '../../../../../../../../lib/types/platform-adapter';
2
- export declare const useNavigation: () => {
3
- navigate: (to: string, options?: NavigateOptions) => void;
4
- navigateToSignIn: (redirectUri?: string) => void;
5
- navigateToSignUp: (redirectUri?: string) => void;
6
- };
@@ -1,27 +0,0 @@
1
- export interface NotificationMessage {
2
- id: number;
3
- user_id: number;
4
- deployment_id: number;
5
- title: string;
6
- body: string;
7
- severity: string;
8
- action_url?: string;
9
- action_label?: string;
10
- created_at: string;
11
- }
12
- export interface UseNotificationStreamOptions {
13
- enabled?: boolean;
14
- channels?: string[];
15
- organizationIds?: number[];
16
- workspaceIds?: number[];
17
- onNotification?: (notification: NotificationMessage) => void;
18
- onError?: (error: string) => void;
19
- reconnectDelay?: number;
20
- maxReconnectAttempts?: number;
21
- }
22
- export declare function useNotificationStream({ enabled, channels, organizationIds, workspaceIds, onNotification, onError, reconnectDelay, maxReconnectAttempts, }?: UseNotificationStreamOptions): {
23
- isConnected: boolean;
24
- connectionError: string | null;
25
- disconnect: () => void;
26
- reconnect: () => void;
27
- };
@@ -1,30 +0,0 @@
1
- import { Notification, NotificationListParams, ChannelCounts } from '../../../../../../../../lib/types/notification';
2
- import { Client } from '../../../../../../../../lib/types';
3
- type UseNotificationsReturnType = {
4
- loading: true;
5
- notifications: never;
6
- unreadCount: never;
7
- unreadCounts: never;
8
- channels: never;
9
- hasMore: never;
10
- markAsRead: never;
11
- markAllAsRead: never;
12
- deleteNotification: never;
13
- error: Error | null;
14
- refetch: () => Promise<void>;
15
- } | {
16
- loading: false;
17
- error: Error | null;
18
- notifications: Notification[];
19
- unreadCount: number;
20
- unreadCounts: ChannelCounts;
21
- channels: string[];
22
- hasMore: boolean;
23
- markAsRead: (notificationId: string) => Promise<void>;
24
- markAllAsRead: () => Promise<void>;
25
- deleteNotification: (notificationId: string) => Promise<void>;
26
- refetch: () => Promise<void>;
27
- };
28
- export declare function fetchChannelCounts(client: Client): Promise<ChannelCounts>;
29
- export declare function useNotifications(params?: NotificationListParams): UseNotificationsReturnType;
30
- export {};
@@ -1,81 +0,0 @@
1
- import { NewDomain, NewOrgnization, Organization, OrganizationDomain, OrganizationInvitation, OrganizationInvitationPayload, OrganizationMembership, OrganizationMembershipWithOrganization, OrganizationRole, OrganizationUpdate, RoleCreate } from '../../../../../../../../lib/types';
2
- export declare const useOrganizationList: () => {
3
- organizations: Organization[] | undefined;
4
- loading: boolean;
5
- error: null;
6
- refetch: () => Promise<void>;
7
- leaveOrganization: (organization: Organization) => Promise<void>;
8
- getOrganizationRoles: (organization: Organization) => Promise<OrganizationRole[]>;
9
- getOrganizationMembers: (organization: Organization) => Promise<OrganizationMembership[]>;
10
- removeOrganizationMember: (organization: Organization, member: OrganizationMembership) => Promise<void>;
11
- createOrganization: (organization: NewOrgnization) => Promise<import('@wacht/types').ApiResult<Organization>>;
12
- getOrganizationInvitations: (organization: Organization) => Promise<OrganizationInvitation[]>;
13
- getOrganizationDomains: (organization: Organization) => Promise<OrganizationDomain[]>;
14
- addOrganizationDomain: (organization: Organization, domain: NewDomain) => Promise<import('@wacht/types').ApiResult<OrganizationDomain>>;
15
- verifyOrganizationDomain: (organization: Organization, domain: OrganizationDomain) => Promise<import('@wacht/types').ApiResult<OrganizationDomain>>;
16
- removeOrganizationDomain: (organization: Organization, domain: OrganizationDomain) => Promise<import('@wacht/types').ApiResult<OrganizationDomain>>;
17
- addRoleToOrganizationMember: (organization: Organization, member: OrganizationMembership, role: OrganizationRole) => Promise<OrganizationMembership>;
18
- removeRoleFromOrganizationMember: (organization: Organization, member: OrganizationMembership, role: OrganizationRole) => Promise<OrganizationMembership>;
19
- inviteOrganizationMember: (organization: Organization, invitation: OrganizationInvitationPayload) => Promise<OrganizationInvitation>;
20
- discardOrganizationInvitation: (organization: Organization, invitation: OrganizationInvitation) => Promise<OrganizationInvitation>;
21
- resendOrganizationInvitation: (organization: Organization, invitation: OrganizationInvitation) => Promise<OrganizationInvitation>;
22
- updateOrganization: (organization: Organization, update: OrganizationUpdate) => Promise<import('@wacht/types').ApiResult<Organization>>;
23
- addRole: (organization: Organization, newRole: RoleCreate) => Promise<import('@wacht/types').ApiResult<OrganizationRole>>;
24
- removeOrganizationRoles: (organization: Organization, role: OrganizationRole) => Promise<void>;
25
- deleteOrganization: (organization: Organization) => Promise<void>;
26
- };
27
- export declare const useActiveOrganization: () => {
28
- activeOrganization: null;
29
- loading: boolean;
30
- error: Error | null;
31
- updateOrganization: never;
32
- getRoles: never;
33
- getMembers: never;
34
- getDomains: never;
35
- addDomain: never;
36
- verifyDomain: never;
37
- removeDomain: never;
38
- removeRole: never;
39
- getInvitations: never;
40
- removeMember: never;
41
- addMemberRole: never;
42
- removeMemberRole: never;
43
- inviteMember: never;
44
- discardInvitation: never;
45
- resendInvitation: never;
46
- leave: never;
47
- refetch?: undefined;
48
- } | {
49
- activeOrganization: Organization | null;
50
- loading: boolean;
51
- refetch: () => Promise<void>;
52
- getRoles: () => Promise<OrganizationRole[]>;
53
- updateOrganization: (update: OrganizationUpdate) => Promise<{
54
- data: never;
55
- errors: import('@wacht/types').ErrorInterface[];
56
- } | never[] | {
57
- data: Organization;
58
- errors: never;
59
- }>;
60
- getMembers: () => Promise<OrganizationMembership[]>;
61
- getDomains: () => Promise<OrganizationDomain[]>;
62
- addDomain: (domain: NewDomain) => Promise<import('@wacht/types').ApiResult<OrganizationDomain> | undefined>;
63
- verifyDomain: (domain: OrganizationDomain) => Promise<import('@wacht/types').ApiResult<OrganizationDomain> | undefined>;
64
- removeDomain: (domain: OrganizationDomain) => Promise<import('@wacht/types').ApiResult<OrganizationDomain> | undefined>;
65
- getInvitations: () => Promise<OrganizationInvitation[]>;
66
- removeMember: (member: OrganizationMembership) => Promise<void | never[]>;
67
- leave: () => Promise<void>;
68
- removeRole: (role: OrganizationRole) => Promise<void>;
69
- addMemberRole: (member: OrganizationMembership, role: OrganizationRole) => Promise<OrganizationMembership | undefined>;
70
- removeMemberRole: (member: OrganizationMembership, role: OrganizationRole) => Promise<OrganizationMembership | undefined>;
71
- inviteMember: (invitationPayload: OrganizationInvitationPayload) => Promise<OrganizationInvitation | undefined>;
72
- discardInvitation: (invitation: OrganizationInvitation) => Promise<OrganizationInvitation | undefined>;
73
- resendInvitation: (invitation: OrganizationInvitation) => Promise<OrganizationInvitation | undefined>;
74
- error: null;
75
- };
76
- export declare const useOrganizationMemberships: () => {
77
- organizationMemberships: OrganizationMembershipWithOrganization[] | undefined;
78
- loading: boolean;
79
- error: any;
80
- refetch: () => Promise<void>;
81
- };
@@ -1,27 +0,0 @@
1
- import { Session } from '../../../../../../../../lib/types';
2
- type UseSessionReturnType = {
3
- loading: true;
4
- session: never;
5
- switchSignIn: never;
6
- switchOrganization: never;
7
- switchWorkspace: never;
8
- signOut: never;
9
- getToken: never;
10
- addNewAccount: never;
11
- error: Error | null;
12
- refetch: () => Promise<void>;
13
- } | {
14
- loading: false;
15
- error: Error | null;
16
- session: Session;
17
- switchSignIn: (signInId: string) => Promise<void>;
18
- signOut: (signInId?: string) => Promise<void>;
19
- getToken: (template?: string) => Promise<string>;
20
- switchOrganization: (organizationId?: string) => Promise<void>;
21
- switchWorkspace: (workspaceId: string) => Promise<void>;
22
- addNewAccount: () => void;
23
- refetch: () => Promise<void>;
24
- };
25
- export declare function clearTokenCache(): void;
26
- export declare function useSession(): UseSessionReturnType;
27
- export {};
@@ -1,132 +0,0 @@
1
- import { ApiResult, ErrorInterface, Session, SigninAttempt, ProfileCompletionData } from '../../../../../../../../lib/types';
2
- type UsernameSignInParams = {
3
- username: string;
4
- password: string;
5
- };
6
- type SignInPlainUsername = ({ username, password, }: UsernameSignInParams) => Promise<ApiResult<Session>>;
7
- type EmailSignInParams = {
8
- email: string;
9
- password: string;
10
- };
11
- type SignInPlainEmail = ({ email, password, }: EmailSignInParams) => Promise<ApiResult<Session>>;
12
- type GenericSignInParams = {
13
- email?: string;
14
- username?: string;
15
- password?: string;
16
- phone?: string;
17
- strategy?: string;
18
- };
19
- type SignInGeneric = ({ email, username, password, phone, strategy, }: GenericSignInParams) => Promise<ApiResult<Session>>;
20
- type PhoneSignInParams = {
21
- phone: string;
22
- };
23
- type SignInPhone = ({ phone, }: PhoneSignInParams) => Promise<ApiResult<Session>>;
24
- type EmailOTPSignInParams = {
25
- email: string;
26
- };
27
- type SignInEmailOTP = ({ email, }: EmailOTPSignInParams) => Promise<ApiResult<Session>>;
28
- type MagicLinkSignInParams = {
29
- email: string;
30
- };
31
- type SignInMagicLink = ({ email, }: MagicLinkSignInParams) => Promise<ApiResult<Session>>;
32
- export declare enum OAuthProvider {
33
- XOauth = "x_oauth",
34
- GithubOauth = "github_oauth",
35
- GitlabOauth = "gitlab_oauth",
36
- GoogleOauth = "google_oauth",
37
- FacebookOauth = "facebook_oauth",
38
- MicrosoftOauth = "microsoft_oauth",
39
- LinkedinOauth = "linkedin_oauth",
40
- DiscordOauth = "discord_oauth",
41
- AppleOauth = "apple_oauth"
42
- }
43
- type SignInOauth = ({ provider, redirectUri, }: {
44
- provider: OAuthProvider;
45
- redirectUri?: string;
46
- }) => Promise<ApiResult<InitSSOResponseType>>;
47
- type SignInStrategy = "username" | "email" | "phone" | "email_otp" | "magic_link" | "oauth" | "generic";
48
- type EmailOTPVerificationParams = {
49
- strategy: "email_otp";
50
- redirectUri?: string;
51
- };
52
- type PhoneOTPVerificationParams = {
53
- strategy: "phone_otp";
54
- lastDigits?: string;
55
- };
56
- type MagicLinkVerificationParams = {
57
- strategy: "magic_link";
58
- redirectUri?: string;
59
- };
60
- type VerificationParams = EmailOTPVerificationParams | PhoneOTPVerificationParams | MagicLinkVerificationParams;
61
- type PrepareVerificationResponse = {
62
- otp_sent?: boolean;
63
- masked_phone?: string;
64
- masked_email?: string;
65
- verification_method?: string;
66
- };
67
- type CreateSignInStrategyResult = {
68
- (strategy: "username"): SignInPlainUsername;
69
- (strategy: "email"): SignInPlainEmail;
70
- (strategy: "phone"): SignInPhone;
71
- (strategy: "email_otp"): SignInEmailOTP;
72
- (strategy: "magic_link"): SignInMagicLink;
73
- (strategy: "oauth"): SignInOauth;
74
- (strategy: "generic"): SignInGeneric;
75
- };
76
- type SignIn = {
77
- createStrategy: CreateSignInStrategyResult;
78
- prepareVerification: (params: VerificationParams) => Promise<ApiResult<PrepareVerificationResponse>>;
79
- completeVerification: (verificationCode: string) => Promise<Session>;
80
- completeProfile: (data: ProfileCompletionData) => Promise<Session>;
81
- };
82
- type UseSignInReturnType = {
83
- loading: false;
84
- signIn: SignIn;
85
- signinAttempt: SigninAttempt | null;
86
- discardSignInAttempt: () => void;
87
- setSignInAttempt: (attempt: SigninAttempt | null) => void;
88
- error: ApiResult<unknown, ErrorInterface> | null;
89
- } | {
90
- loading: true;
91
- signIn: never;
92
- signinAttempt: null;
93
- discardSignInAttempt: () => void;
94
- setSignInAttempt: (attempt: SigninAttempt | null) => void;
95
- error: null;
96
- };
97
- type InitSSOResponseType = {
98
- oauth_url: string;
99
- session: Session;
100
- };
101
- export declare function useSignIn(): UseSignInReturnType;
102
- type SignInFunction<T extends SignInStrategy> = {
103
- ["username"]: SignInPlainUsername;
104
- ["email"]: SignInPlainEmail;
105
- ["phone"]: SignInPhone;
106
- ["email_otp"]: SignInEmailOTP;
107
- ["magic_link"]: SignInMagicLink;
108
- ["oauth"]: SignInOauth;
109
- ["generic"]: SignInGeneric;
110
- }[T];
111
- export type UseSignInWithStrategyReturnType<T extends SignInStrategy> = {
112
- loading: true;
113
- signIn: never;
114
- signinAttempt: null;
115
- discardSignInAttempt: () => void;
116
- setSignInAttempt: (attempt: SigninAttempt | null) => void;
117
- error: null;
118
- } | {
119
- loading: false;
120
- signIn: {
121
- create: SignInFunction<T>;
122
- completeVerification: (verificationCode: string) => Promise<Session>;
123
- prepareVerification: (params: VerificationParams) => Promise<ApiResult<PrepareVerificationResponse>>;
124
- completeProfile: (data: ProfileCompletionData) => Promise<Session>;
125
- };
126
- signinAttempt: SigninAttempt | null;
127
- discardSignInAttempt: () => void;
128
- setSignInAttempt: (attempt: SigninAttempt | null) => void;
129
- error: ApiResult<unknown, ErrorInterface> | null;
130
- };
131
- export declare function useSignInWithStrategy<T extends SignInStrategy>(strategy: T): UseSignInWithStrategyReturnType<T>;
132
- export {};
@@ -1,46 +0,0 @@
1
- import { ApiResult, ErrorInterface, Session, SignupAttempt, SignUpParams } from '../../../../../../../../lib/types';
2
- export interface DeploymentInvitationData {
3
- valid: boolean;
4
- first_name?: string;
5
- last_name?: string;
6
- email?: string;
7
- message?: string;
8
- error_code?: string;
9
- }
10
- export type SignUpFunction = {
11
- create: (params: SignUpParams) => Promise<ApiResult<unknown, ErrorInterface>>;
12
- prepareVerification: (params: SignupVerificationParams) => Promise<ApiResult<PrepareVerificationResponse>>;
13
- completeVerification: (verificationCode: string) => Promise<ApiResult<Session>>;
14
- validateDeploymentInvitation: (token: string) => Promise<DeploymentInvitationData>;
15
- };
16
- export type SignupVerificationStrategy = "email_otp" | "phone_otp";
17
- type SignupEmailOTPVerificationParams = {
18
- strategy: "email_otp";
19
- redirectUri?: string;
20
- };
21
- type SignupPhoneOTPVerificationParams = {
22
- strategy: "phone_otp";
23
- lastDigits?: string;
24
- };
25
- type SignupVerificationParams = SignupEmailOTPVerificationParams | SignupPhoneOTPVerificationParams;
26
- type PrepareVerificationResponse = {
27
- otp_sent?: boolean;
28
- masked_phone?: string;
29
- masked_email?: string;
30
- verification_method?: string;
31
- };
32
- export type UseSignUpReturnType = {
33
- loading: true;
34
- signUp: never;
35
- signupAttempt: null;
36
- discardSignupAttempt: () => void;
37
- errors: null;
38
- } | {
39
- loading: false;
40
- signUp: SignUpFunction;
41
- signupAttempt: SignupAttempt | null;
42
- discardSignupAttempt: () => void;
43
- errors: ApiResult<unknown, ErrorInterface> | null;
44
- };
45
- export declare function useSignUp(): UseSignUpReturnType;
46
- export {};
@@ -1,15 +0,0 @@
1
- import { Session, SigninAttempt } from '../../../../../../../../lib/types';
2
- interface SSOCallbackState {
3
- loading: boolean;
4
- error: Error | null;
5
- session: Session | null;
6
- redirectUri: string | null;
7
- processed: boolean;
8
- signinAttempt: SigninAttempt | null;
9
- }
10
- /**
11
- * Headless hook for handling SSO OAuth callback
12
- * Automatically processes URL parameters and handles the callback flow
13
- */
14
- export declare function useSSOCallback(): SSOCallbackState;
15
- export {};
@@ -1,83 +0,0 @@
1
- import { CurrentUser, UserAuthenticator, UserEmailAddress, UserPhoneNumber, SignIn } from '../../../../../../../../lib/types';
2
- type SecondFactorPolicy = "none" | "optional" | "enforced";
3
- interface ProfileUpdateData {
4
- first_name?: string;
5
- last_name?: string;
6
- username?: string;
7
- primary_email_address_id?: string;
8
- primary_phone_number_id?: string;
9
- second_factor_policy?: SecondFactorPolicy;
10
- remove_profile_picture?: boolean;
11
- }
12
- export declare function useUser(): {
13
- user: {
14
- refetch: import('swr').KeyedMutator<CurrentUser>;
15
- id?: string | undefined;
16
- first_name?: string | undefined;
17
- last_name?: string | undefined;
18
- username?: string | undefined;
19
- availability?: "available" | "busy" | "away" | undefined;
20
- has_profile_picture?: string | undefined;
21
- profile_picture_url?: string | undefined;
22
- primary_email_address_id?: string | undefined;
23
- primary_phone_number_id?: string | undefined;
24
- primary_email_address?: UserEmailAddress | undefined;
25
- primary_phone_number?: UserPhoneNumber;
26
- second_factor_policy?: import('@wacht/types').SecondFactorPolicy | undefined;
27
- user_email_addresses?: UserEmailAddress[] | undefined;
28
- user_phone_numbers?: UserPhoneNumber[] | undefined;
29
- email_addresses?: UserEmailAddress[];
30
- phone_numbers?: UserPhoneNumber[];
31
- social_connections?: import('@wacht/types').SocialConnection[] | undefined;
32
- user_authenticator?: UserAuthenticator;
33
- authenticators?: UserAuthenticator[];
34
- backup_codes_generated?: boolean;
35
- backup_codes?: string[];
36
- has_password?: boolean | undefined;
37
- public_metadata?: Record<string, unknown> | undefined;
38
- };
39
- loading: boolean;
40
- error: any;
41
- updateProfile: (data: ProfileUpdateData) => Promise<import('@wacht/types').ApiResult<unknown>>;
42
- getEmailAddresses: () => Promise<import('@wacht/types').ApiResult<unknown>>;
43
- getEmailAddress: (id: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
44
- createEmailAddress: (email: string) => Promise<import('@wacht/types').ApiResult<UserEmailAddress>>;
45
- deleteEmailAddress: (id: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
46
- prepareEmailVerification: (id: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
47
- attemptEmailVerification: (id: string, otp: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
48
- makeEmailPrimary: (id: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
49
- createPhoneNumber: (phone_number: string, country_code: string) => Promise<import('@wacht/types').ApiResult<UserPhoneNumber>>;
50
- deletePhoneNumber: (id: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
51
- preparePhoneVerification: (id: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
52
- attemptPhoneVerification: (id: string, otp: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
53
- makePhonePrimary: (id: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
54
- setupAuthenticator: () => Promise<UserAuthenticator>;
55
- verifyAuthenticator: (id: string, codes: string[]) => Promise<import('@wacht/types').ApiResult<unknown>>;
56
- deleteAuthenticator: (id: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
57
- generateBackupCodes: () => Promise<string[]>;
58
- regenerateBackupCodes: () => Promise<string[]>;
59
- updateProfilePicture: (file: File) => Promise<import('@wacht/types').ApiResult<unknown>>;
60
- disconnectSocialConnection: (id: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
61
- connectSocialAccount: ({ provider, redirectUri, }: {
62
- provider: string;
63
- redirectUri?: string;
64
- }) => Promise<import('@wacht/types').ApiResult<{
65
- oauth_url: string;
66
- }>>;
67
- updatePassword: (currentPassword: string, newPassword: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
68
- removePassword: (currentPassword: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
69
- deleteAccount: (password: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
70
- };
71
- export declare function useUserSignins(): {
72
- signins: SignIn[] | undefined;
73
- error: any;
74
- removeSignin: (id: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
75
- refetch: import('swr').KeyedMutator<SignIn[]>;
76
- loading: boolean;
77
- };
78
- export declare function useActiveTenancy(): {
79
- loading: boolean;
80
- orgMembership: import('@wacht/types').OrganizationMembershipWithOrganization | null | undefined;
81
- workspaceMembership: import('@wacht/types').WorkspaceMembership | null | undefined;
82
- };
83
- export {};