@wacht/jsx 0.0.1-alpha.2 → 0.0.1-alpha.21

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 (150) hide show
  1. package/dist/index.cjs.js +930 -862
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +1332 -5
  4. package/dist/index.es.js +8579 -8274
  5. package/dist/index.es.js.map +1 -1
  6. package/package.json +2 -2
  7. package/dist/components/agent/agent-conversation-history.d.ts +0 -5
  8. package/dist/components/agent/agent-conversation-hub.d.ts +0 -1
  9. package/dist/components/agent/agent-conversation.d.ts +0 -5
  10. package/dist/components/agent/index.d.ts +0 -3
  11. package/dist/components/agent/user-input-request.d.ts +0 -7
  12. package/dist/components/auth/accept-invite.d.ts +0 -7
  13. package/dist/components/auth/auth-image.d.ts +0 -1
  14. package/dist/components/auth/forgot-password.d.ts +0 -5
  15. package/dist/components/auth/index.d.ts +0 -13
  16. package/dist/components/auth/magic-link-verification.d.ts +0 -6
  17. package/dist/components/auth/other-auth-options.d.ts +0 -1
  18. package/dist/components/auth/other-signin-options.d.ts +0 -5
  19. package/dist/components/auth/phone-verification.d.ts +0 -7
  20. package/dist/components/auth/profile-completion.d.ts +0 -2
  21. package/dist/components/auth/signin-form.d.ts +0 -1
  22. package/dist/components/auth/signup-form.d.ts +0 -1
  23. package/dist/components/auth/social-buttons.d.ts +0 -7
  24. package/dist/components/auth/sso-callback.d.ts +0 -2
  25. package/dist/components/auth/two-factor-method-selector.d.ts +0 -15
  26. package/dist/components/auth/two-factor-verification.d.ts +0 -2
  27. package/dist/components/auth/waitlist-form.d.ts +0 -1
  28. package/dist/components/control/index.d.ts +0 -5
  29. package/dist/components/control/navigation.d.ts +0 -2
  30. package/dist/components/control/require-active-tenancy.d.ts +0 -5
  31. package/dist/components/control/signed-in-accounts.d.ts +0 -6
  32. package/dist/components/control/signed-in.d.ts +0 -5
  33. package/dist/components/control/signed-out.d.ts +0 -5
  34. package/dist/components/control/user-selection.d.ts +0 -0
  35. package/dist/components/deployment-instance.d.ts +0 -7
  36. package/dist/components/icons/apple.d.ts +0 -1
  37. package/dist/components/icons/brave.d.ts +0 -1
  38. package/dist/components/icons/chevron-right.d.ts +0 -1
  39. package/dist/components/icons/chrome.d.ts +0 -2
  40. package/dist/components/icons/discord.d.ts +0 -1
  41. package/dist/components/icons/edge.d.ts +0 -2
  42. package/dist/components/icons/facebook.d.ts +0 -1
  43. package/dist/components/icons/firefox.d.ts +0 -2
  44. package/dist/components/icons/github.d.ts +0 -1
  45. package/dist/components/icons/gitlab.d.ts +0 -1
  46. package/dist/components/icons/google.d.ts +0 -1
  47. package/dist/components/icons/key.d.ts +0 -1
  48. package/dist/components/icons/linkedin.d.ts +0 -1
  49. package/dist/components/icons/microsoft.d.ts +0 -1
  50. package/dist/components/icons/opera.d.ts +0 -1
  51. package/dist/components/icons/safari.d.ts +0 -2
  52. package/dist/components/icons/shield.d.ts +0 -1
  53. package/dist/components/icons/smartphone.d.ts +0 -1
  54. package/dist/components/icons/x.d.ts +0 -1
  55. package/dist/components/index.d.ts +0 -17
  56. package/dist/components/notifications/channel-selector.d.ts +0 -8
  57. package/dist/components/notifications/index.d.ts +0 -4
  58. package/dist/components/notifications/notification-bell.d.ts +0 -9
  59. package/dist/components/notifications/notification-item.d.ts +0 -8
  60. package/dist/components/notifications/notification-popover.d.ts +0 -16
  61. package/dist/components/organization/add-domain-popover.d.ts +0 -8
  62. package/dist/components/organization/add-role-popover.d.ts +0 -14
  63. package/dist/components/organization/context.d.ts +0 -9
  64. package/dist/components/organization/create-organization-dialog.d.ts +0 -8
  65. package/dist/components/organization/create-organization-form.d.ts +0 -6
  66. package/dist/components/organization/index.d.ts +0 -3
  67. package/dist/components/organization/invite-member-popover.d.ts +0 -9
  68. package/dist/components/organization/manage-organization-dialog.d.ts +0 -14
  69. package/dist/components/organization/manage-organization.d.ts +0 -1
  70. package/dist/components/organization/organization-selector-menu.d.ts +0 -7
  71. package/dist/components/organization/organization-switcher.d.ts +0 -5
  72. package/dist/components/user/2fa-styles.d.ts +0 -56
  73. package/dist/components/user/2fa.d.ts +0 -20
  74. package/dist/components/user/add-email-popover.d.ts +0 -10
  75. package/dist/components/user/add-phone-popover.d.ts +0 -10
  76. package/dist/components/user/backup-codes-popover.d.ts +0 -9
  77. package/dist/components/user/change-password-popover.d.ts +0 -8
  78. package/dist/components/user/context.d.ts +0 -9
  79. package/dist/components/user/index.d.ts +0 -4
  80. package/dist/components/user/manage-account-dialog.d.ts +0 -14
  81. package/dist/components/user/manage-account.d.ts +0 -2
  82. package/dist/components/user/remove-password-popover.d.ts +0 -7
  83. package/dist/components/user/setup-totp-popover.d.ts +0 -12
  84. package/dist/components/user/user-button.d.ts +0 -6
  85. package/dist/components/user/user-controls.d.ts +0 -7
  86. package/dist/components/utility/button.d.ts +0 -7
  87. package/dist/components/utility/combo-box.d.ts +0 -39
  88. package/dist/components/utility/confirmation-popover.d.ts +0 -7
  89. package/dist/components/utility/dialog.d.ts +0 -49
  90. package/dist/components/utility/dropdown.d.ts +0 -20
  91. package/dist/components/utility/empty-state.d.ts +0 -8
  92. package/dist/components/utility/form.d.ts +0 -3
  93. package/dist/components/utility/index.d.ts +0 -14
  94. package/dist/components/utility/input.d.ts +0 -1
  95. package/dist/components/utility/loader.d.ts +0 -7
  96. package/dist/components/utility/navigation.d.ts +0 -8
  97. package/dist/components/utility/otp-input.d.ts +0 -9
  98. package/dist/components/utility/phone.d.ts +0 -7
  99. package/dist/components/utility/root.d.ts +0 -1
  100. package/dist/components/utility/search.d.ts +0 -7
  101. package/dist/components/utility/spinner.d.ts +0 -6
  102. package/dist/components/utility/switch.d.ts +0 -7
  103. package/dist/components/utility/table.d.ts +0 -8
  104. package/dist/components/utility/tabs.d.ts +0 -34
  105. package/dist/components/utility/use-dialog.d.ts +0 -12
  106. package/dist/components/workspace/add-role-popover.d.ts +0 -13
  107. package/dist/components/workspace/create-workspace-dialog.d.ts +0 -9
  108. package/dist/components/workspace/create-workspace-form.d.ts +0 -9
  109. package/dist/components/workspace/index.d.ts +0 -4
  110. package/dist/components/workspace/invite-member-popover.d.ts +0 -10
  111. package/dist/components/workspace/manage-workspace-dialog.d.ts +0 -14
  112. package/dist/components/workspace/manage-workspace.d.ts +0 -1
  113. package/dist/constants/ai-agent.d.ts +0 -43
  114. package/dist/constants/execution-status.d.ts +0 -38
  115. package/dist/constants/geo.d.ts +0 -8
  116. package/dist/context/agent-conversation-provider.d.ts +0 -37
  117. package/dist/context/deployment-provider.d.ts +0 -10
  118. package/dist/context/index.d.ts +0 -2
  119. package/dist/context/signin-provider.d.ts +0 -21
  120. package/dist/hooks/index.d.ts +0 -22
  121. package/dist/hooks/use-agent-conversation.d.ts +0 -61
  122. package/dist/hooks/use-channel-counts.d.ts +0 -14
  123. package/dist/hooks/use-client.d.ts +0 -7
  124. package/dist/hooks/use-context-manager.d.ts +0 -30
  125. package/dist/hooks/use-conversation-sessions.d.ts +0 -32
  126. package/dist/hooks/use-deployment.d.ts +0 -1
  127. package/dist/hooks/use-forgot-password.d.ts +0 -11
  128. package/dist/hooks/use-invitation.d.ts +0 -23
  129. package/dist/hooks/use-magic-link.d.ts +0 -14
  130. package/dist/hooks/use-navigation.d.ts +0 -6
  131. package/dist/hooks/use-notification-stream.d.ts +0 -27
  132. package/dist/hooks/use-notifications.d.ts +0 -30
  133. package/dist/hooks/use-organization.d.ts +0 -81
  134. package/dist/hooks/use-session.d.ts +0 -26
  135. package/dist/hooks/use-signin.d.ts +0 -140
  136. package/dist/hooks/use-signup.d.ts +0 -46
  137. package/dist/hooks/use-sso-callback.d.ts +0 -15
  138. package/dist/hooks/use-user.d.ts +0 -78
  139. package/dist/hooks/use-waitlist.d.ts +0 -24
  140. package/dist/hooks/use-workspace.d.ts +0 -50
  141. package/dist/models/websocket.d.ts +0 -25
  142. package/dist/services/websocket-manager.d.ts +0 -46
  143. package/dist/types/deployment-context.d.ts +0 -7
  144. package/dist/types/index.d.ts +0 -4
  145. package/dist/types/notification.d.ts +0 -51
  146. package/dist/types/platform-adapter.d.ts +0 -10
  147. package/dist/utils/event-emitter.d.ts +0 -9
  148. package/dist/utils/navigation.d.ts +0 -2
  149. package/dist/utils/profile-completion.d.ts +0 -3
  150. package/dist/utils/response-mapper.d.ts +0 -2
@@ -1,22 +0,0 @@
1
- export * from './use-signin';
2
- export * from './use-signup';
3
- export * from './use-session';
4
- export * from './use-client';
5
- export * from './use-deployment';
6
- export * from './use-user';
7
- export * from './use-waitlist';
8
- export * from './use-organization';
9
- export * from './use-workspace';
10
- export * from './use-sso-callback';
11
- export * from './use-magic-link';
12
- export * from './use-navigation';
13
- export * from './use-forgot-password';
14
- export * from './use-notifications';
15
- export * from './use-notification-stream';
16
- export * from './use-channel-counts';
17
- export { useAgentConversation } from './use-agent-conversation';
18
- export type { UserInputRequest, ConversationMessage } from './use-agent-conversation';
19
- export { useConversationSessions } from './use-conversation-sessions';
20
- export type { ConversationSession, CreateSessionRequest, ListSessionsOptions, ListSessionsResponse } from './use-conversation-sessions';
21
- export { useInvitation } from './use-invitation';
22
- export type { AcceptInvitationResponse } from './use-invitation';
@@ -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,11 +0,0 @@
1
- import { ApiResult, ErrorInterface } from '../../../../../../../../lib/types';
2
- export declare function useForgotPassword(): {
3
- loading: boolean;
4
- forgotPassword: (email: string) => Promise<ApiResult<{}, ErrorInterface>>;
5
- error: Error | null;
6
- };
7
- export declare function useResetPassword(): {
8
- loading: boolean;
9
- resetPassword: (email: string, otp: string, password: string) => Promise<ApiResult<{}, ErrorInterface>>;
10
- error: Error | null;
11
- };
@@ -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: import('swr').KeyedMutator<OrganizationMembershipWithOrganization[]>;
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: import('swr').KeyedMutator<OrganizationMembershipWithOrganization[]>;
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: import('swr').KeyedMutator<OrganizationMembershipWithOrganization[]>;
81
- };
@@ -1,26 +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 useSession(): UseSessionReturnType;
26
- export {};
@@ -1,140 +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
- export declare enum SignInStrategy {
48
- Username = "username",
49
- Email = "email",
50
- Phone = "phone",
51
- EmailOTP = "email_otp",
52
- MagicLink = "magic_link",
53
- Oauth = "oauth",
54
- Generic = "generic"
55
- }
56
- type EmailOTPVerificationParams = {
57
- strategy: "email_otp";
58
- redirectUri?: string;
59
- };
60
- type PhoneOTPVerificationParams = {
61
- strategy: "phone_otp";
62
- lastDigits?: string;
63
- };
64
- type MagicLinkVerificationParams = {
65
- strategy: "magic_link";
66
- redirectUri?: string;
67
- };
68
- type VerificationParams = EmailOTPVerificationParams | PhoneOTPVerificationParams | MagicLinkVerificationParams;
69
- type PrepareVerificationResponse = {
70
- otp_sent?: boolean;
71
- masked_phone?: string;
72
- masked_email?: string;
73
- verification_method?: string;
74
- };
75
- type CreateSignInStrategyResult = {
76
- (strategy: SignInStrategy.Username): SignInPlainUsername;
77
- (strategy: SignInStrategy.Email): SignInPlainEmail;
78
- (strategy: SignInStrategy.Phone): SignInPhone;
79
- (strategy: SignInStrategy.EmailOTP): SignInEmailOTP;
80
- (strategy: SignInStrategy.MagicLink): SignInMagicLink;
81
- (strategy: SignInStrategy.Oauth): SignInOauth;
82
- (strategy: SignInStrategy.Generic): SignInGeneric;
83
- };
84
- type SignIn = {
85
- createStrategy: CreateSignInStrategyResult;
86
- prepareVerification: (params: VerificationParams) => Promise<ApiResult<PrepareVerificationResponse>>;
87
- completeVerification: (verificationCode: string) => Promise<Session>;
88
- completeProfile: (data: ProfileCompletionData) => Promise<Session>;
89
- };
90
- type UseSignInReturnType = {
91
- loading: false;
92
- signIn: SignIn;
93
- signinAttempt: SigninAttempt | null;
94
- discardSignInAttempt: () => void;
95
- setSignInAttempt: (attempt: SigninAttempt | null) => void;
96
- error: ApiResult<unknown, ErrorInterface> | null;
97
- } | {
98
- loading: true;
99
- signIn: never;
100
- signinAttempt: null;
101
- discardSignInAttempt: () => void;
102
- setSignInAttempt: (attempt: SigninAttempt | null) => void;
103
- error: null;
104
- };
105
- type InitSSOResponseType = {
106
- oauth_url: string;
107
- session: Session;
108
- };
109
- export declare function useSignIn(): UseSignInReturnType;
110
- type SignInFunction<T extends SignInStrategy> = {
111
- [SignInStrategy.Username]: SignInPlainUsername;
112
- [SignInStrategy.Email]: SignInPlainEmail;
113
- [SignInStrategy.Phone]: SignInPhone;
114
- [SignInStrategy.EmailOTP]: SignInEmailOTP;
115
- [SignInStrategy.MagicLink]: SignInMagicLink;
116
- [SignInStrategy.Oauth]: SignInOauth;
117
- [SignInStrategy.Generic]: SignInGeneric;
118
- }[T];
119
- export type UseSignInWithStrategyReturnType<T extends SignInStrategy> = {
120
- loading: true;
121
- signIn: never;
122
- signinAttempt: null;
123
- discardSignInAttempt: () => void;
124
- setSignInAttempt: (attempt: SigninAttempt | null) => void;
125
- error: null;
126
- } | {
127
- loading: false;
128
- signIn: {
129
- create: SignInFunction<T>;
130
- completeVerification: (verificationCode: string) => Promise<Session>;
131
- prepareVerification: (params: VerificationParams) => Promise<ApiResult<PrepareVerificationResponse>>;
132
- completeProfile: (data: ProfileCompletionData) => Promise<Session>;
133
- };
134
- signinAttempt: SigninAttempt | null;
135
- discardSignInAttempt: () => void;
136
- setSignInAttempt: (attempt: SigninAttempt | null) => void;
137
- error: ApiResult<unknown, ErrorInterface> | null;
138
- };
139
- export declare function useSignInWithStrategy<T extends SignInStrategy>(strategy: T): UseSignInWithStrategyReturnType<T>;
140
- 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 {};