@wacht/jsx 1.0.0-beta.11 → 1.0.0-beta.23

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/dist/index.d.ts CHANGED
@@ -31,7 +31,6 @@ import { DeploymentUISettings } from '@wacht/types';
31
31
  import { DetailedHTMLProps } from 'react';
32
32
  import { EndpointWithSubscriptions } from '@wacht/types';
33
33
  import { EnterpriseConnection } from '@wacht/types';
34
- import { ErrorInterface } from '@wacht/types';
35
34
  import { FastOmit } from 'styled-components';
36
35
  import { FC } from 'react';
37
36
  import { FileData } from '@wacht/types';
@@ -392,7 +391,7 @@ export declare function hasOrgPermission(membership: WithOrgRoles, requiredPermi
392
391
  */
393
392
  export declare function hasWorkspacePermission(membership: WithWsRoles, requiredPermissions: string[]): boolean;
394
393
 
395
- export declare interface IdentifyResult {
394
+ declare interface IdentifyResult {
396
395
  strategy: "sso" | "social" | "password";
397
396
  connection_id?: string;
398
397
  idp_url?: string;
@@ -422,7 +421,7 @@ export declare function isWorkspaceAdmin(membership: WithWsRoles): boolean;
422
421
 
423
422
  export declare const Label: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
424
423
 
425
- export declare interface MagicLinkParams {
424
+ declare interface MagicLinkParams {
426
425
  token?: string;
427
426
  attempt?: string;
428
427
  redirectUri?: string;
@@ -726,17 +725,6 @@ declare type SignInEmailOTP = ({ email, }: EmailOTPSignInParams) => Promise<ApiR
726
725
 
727
726
  export declare function SignInForm(): JSX.Element;
728
727
 
729
- declare type SignInFunction<T extends SignInStrategy> = {
730
- ["username"]: SignInPlainUsername;
731
- ["email"]: SignInPlainEmail;
732
- ["phone"]: SignInPhone;
733
- ["email_otp"]: SignInEmailOTP;
734
- ["magic_link"]: SignInMagicLink;
735
- ["oauth"]: SignInOauth;
736
- ["passkey"]: SignInPasskey;
737
- ["generic"]: SignInGeneric;
738
- }[T];
739
-
740
728
  declare type SignInGeneric = ({ email, username, password, phone, strategy, }: GenericSignInParams) => Promise<ApiResult<Session>>;
741
729
 
742
730
  declare type SignInMagicLink = ({ email, }: MagicLinkSignInParams) => Promise<ApiResult<Session>>;
@@ -754,8 +742,6 @@ declare type SignInPlainEmail = ({ email, password, }: EmailSignInParams) => Pro
754
742
 
755
743
  declare type SignInPlainUsername = ({ username, password, }: UsernameSignInParams) => Promise<ApiResult<Session>>;
756
744
 
757
- declare type SignInStrategy = "username" | "email" | "phone" | "email_otp" | "magic_link" | "oauth" | "passkey" | "generic";
758
-
759
745
  declare type SignupEmailOTPVerificationParams = {
760
746
  strategy: "email_otp";
761
747
  redirectUri?: string;
@@ -764,7 +750,7 @@ declare type SignupEmailOTPVerificationParams = {
764
750
  export declare function SignUpForm(): JSX.Element;
765
751
 
766
752
  export declare type SignUpFunction = {
767
- create: (params: SignUpParams) => Promise<ApiResult<unknown, ErrorInterface>>;
753
+ create: (params: SignUpParams) => Promise<ApiResult<unknown>>;
768
754
  prepareVerification: (params: SignupVerificationParams) => Promise<ApiResult<PrepareVerificationResponse_2>>;
769
755
  completeVerification: (verificationCode: string) => Promise<ApiResult<Session>>;
770
756
  validateDeploymentInvitation: (token: string) => Promise<DeploymentInvitationData>;
@@ -974,8 +960,10 @@ export declare function useActorMcpServers(enabled?: boolean): {
974
960
  servers: ActorMcpServerSummary[];
975
961
  loading: boolean;
976
962
  error: any;
977
- connect: (mcpServerId: string) => Promise<ActorMcpServerConnectResponse>;
978
- disconnect: (mcpServerId: string) => Promise<void>;
963
+ connect: (mcpServerId: string) => Promise<ApiResult<ActorMcpServerConnectResponse>>;
964
+ disconnect: (mcpServerId: string) => Promise<ApiResult< {
965
+ success: boolean;
966
+ }>>;
979
967
  refetch: () => Promise<void>;
980
968
  };
981
969
 
@@ -986,10 +974,10 @@ export declare function useActorProjects(options?: {
986
974
  projects: ActorProject[];
987
975
  loading: boolean;
988
976
  error: any;
989
- createProject: (request: CreateActorProjectRequest) => Promise<ActorProject>;
990
- updateProject: (projectId: string, request: UpdateActorProjectRequest) => Promise<ActorProject>;
991
- archiveProject: (projectId: string) => Promise<ActorProject>;
992
- unarchiveProject: (projectId: string) => Promise<ActorProject>;
977
+ createProject: (request: CreateActorProjectRequest) => Promise<ApiResult<ActorProject>>;
978
+ updateProject: (projectId: string, request: UpdateActorProjectRequest) => Promise<ApiResult<ActorProject>>;
979
+ archiveProject: (projectId: string) => Promise<ApiResult<ActorProject>>;
980
+ unarchiveProject: (projectId: string) => Promise<ApiResult<ActorProject>>;
993
981
  refetch: () => Promise<void>;
994
982
  };
995
983
 
@@ -1029,9 +1017,9 @@ export declare function useAgentThread(threadId?: string, enabled?: boolean): {
1029
1017
  thread: AgentThread | null;
1030
1018
  loading: boolean;
1031
1019
  error: any;
1032
- updateThread: (request: UpdateAgentThreadRequest) => Promise<AgentThread>;
1033
- archiveThread: () => Promise<AgentThread>;
1034
- unarchiveThread: () => Promise<AgentThread>;
1020
+ updateThread: (request: UpdateAgentThreadRequest) => Promise<ApiResult<AgentThread>>;
1021
+ archiveThread: () => Promise<ApiResult<AgentThread>>;
1022
+ unarchiveThread: () => Promise<ApiResult<AgentThread>>;
1035
1023
  refetch: () => Promise<void>;
1036
1024
  };
1037
1025
 
@@ -1161,9 +1149,9 @@ export declare function useApiAuthKeys(filters?: UseApiAuthKeysFilters): UseApiA
1161
1149
 
1162
1150
  declare interface UseApiAuthKeysReturn {
1163
1151
  keys: ApiKey[];
1164
- createKey: (input: CreateApiAuthKeyInput) => Promise<ApiKeyWithSecret>;
1165
- rotateKey: (input: RotateApiAuthKeyInput) => Promise<ApiKeyWithSecret>;
1166
- revokeKey: (input: RevokeApiAuthKeyInput) => Promise<void>;
1152
+ createKey: (input: CreateApiAuthKeyInput) => Promise<ApiResult<ApiKeyWithSecret>>;
1153
+ rotateKey: (input: RotateApiAuthKeyInput) => Promise<ApiResult<ApiKeyWithSecret>>;
1154
+ revokeKey: (input: RevokeApiAuthKeyInput) => Promise<ApiResult<void>>;
1167
1155
  loading: boolean;
1168
1156
  error: unknown;
1169
1157
  refetch: () => void;
@@ -1179,7 +1167,7 @@ declare type UseClientReturnType = {
1179
1167
  export declare function useCreateWebhookEndpoint(): UseCreateWebhookEndpointReturn;
1180
1168
 
1181
1169
  declare interface UseCreateWebhookEndpointReturn {
1182
- createEndpoint: (options: CreateEndpointOptions) => Promise<EndpointWithSubscriptions>;
1170
+ createEndpoint: (options: CreateEndpointOptions) => Promise<ApiResult<EndpointWithSubscriptions>>;
1183
1171
  loading: boolean;
1184
1172
  error: unknown;
1185
1173
  }
@@ -1188,11 +1176,11 @@ export declare function useDeployment(): DeploymentContextType;
1188
1176
 
1189
1177
  export declare function useForgotPassword(): {
1190
1178
  loading: boolean;
1191
- forgotPassword: (email: string) => Promise<ApiResult<{}, ErrorInterface>>;
1179
+ forgotPassword: (email: string) => Promise<ApiResult<{}>>;
1192
1180
  verifyOtp: (email: string, otp: string) => Promise<ApiResult<{
1193
1181
  token: string;
1194
- }, ErrorInterface>>;
1195
- resetPassword: (token: string, password: string) => Promise<ApiResult<Session, ErrorInterface>>;
1182
+ }>>;
1183
+ resetPassword: (token: string, password: string) => Promise<ApiResult<Session>>;
1196
1184
  };
1197
1185
 
1198
1186
  export declare const useInvitation: () => {
@@ -1203,13 +1191,11 @@ export declare const useInvitation: () => {
1203
1191
  reset: () => void;
1204
1192
  };
1205
1193
 
1206
- export declare function useMagicLinkParams(): MagicLinkParams;
1207
-
1208
1194
  export declare function useMagicLinkVerification(): UseMagicLinkVerificationReturnType;
1209
1195
 
1210
- export declare interface UseMagicLinkVerificationReturnType {
1196
+ declare interface UseMagicLinkVerificationReturnType {
1211
1197
  loading: boolean;
1212
- verifyMagicLink: (params: MagicLinkParams) => Promise<ApiResult<{}, ErrorInterface>>;
1198
+ verifyMagicLink: (params: MagicLinkParams) => Promise<ApiResult<{}>>;
1213
1199
  success: boolean | null;
1214
1200
  }
1215
1201
 
@@ -1272,6 +1258,8 @@ export declare interface UseNotificationStreamOptions {
1272
1258
  maxReconnectAttempts?: number;
1273
1259
  }
1274
1260
 
1261
+ export declare function useNotificationUnreadCount(params?: NotificationListParams): UseScopeUnreadReturnType;
1262
+
1275
1263
  export declare const useOrganizationList: () => {
1276
1264
  organizations: Organization[] | undefined;
1277
1265
  loading: boolean;
@@ -1354,12 +1342,12 @@ export declare function useProjectTaskBoardItem(projectId?: string, itemId?: str
1354
1342
  taskWorkspaceError: any;
1355
1343
  loading: boolean;
1356
1344
  error: any;
1357
- updateItem: (request: UpdateProjectTaskBoardItemRequest, files?: File[]) => Promise<ProjectTaskBoardItem>;
1358
- archiveItem: () => Promise<ProjectTaskBoardItem>;
1359
- unarchiveItem: () => Promise<ProjectTaskBoardItem>;
1360
- getTaskWorkspaceFile: (path: string) => Promise<ProjectTaskWorkspaceFileContent>;
1361
- listTaskWorkspaceDirectory: (path?: string) => Promise<ProjectTaskWorkspaceListing>;
1362
- appendJournal: (request: AppendProjectTaskBoardItemJournalRequest, files?: File[]) => Promise<ProjectTaskBoardItemEvent>;
1345
+ updateItem: (request: UpdateProjectTaskBoardItemRequest, files?: File[]) => Promise<ApiResult<ProjectTaskBoardItem>>;
1346
+ archiveItem: () => Promise<ApiResult<ProjectTaskBoardItem>>;
1347
+ unarchiveItem: () => Promise<ApiResult<ProjectTaskBoardItem>>;
1348
+ getTaskWorkspaceFile: (path: string) => Promise<ApiResult<ProjectTaskWorkspaceFileContent>>;
1349
+ listTaskWorkspaceDirectory: (path?: string) => Promise<ApiResult<ProjectTaskWorkspaceListing>>;
1350
+ appendJournal: (request: AppendProjectTaskBoardItemJournalRequest, files?: File[]) => Promise<ApiResult<ProjectTaskBoardItemEvent>>;
1363
1351
  refetch: () => Promise<void>;
1364
1352
  refetchEvents: () => Promise<void>;
1365
1353
  refetchAssignments: () => Promise<void>;
@@ -1373,9 +1361,9 @@ export declare function useProjectTasks(projectId?: string, enabled?: boolean, o
1373
1361
  hasMore: boolean;
1374
1362
  loadingMore: boolean;
1375
1363
  loadMore: () => Promise<void>;
1376
- createTask: (request: CreateProjectTaskBoardItemRequest, files?: File[]) => Promise<ProjectTaskBoardItem>;
1377
- archiveTask: (itemId: string) => Promise<ProjectTaskBoardItem>;
1378
- unarchiveTask: (itemId: string) => Promise<ProjectTaskBoardItem>;
1364
+ createTask: (request: CreateProjectTaskBoardItemRequest, files?: File[]) => Promise<ApiResult<ProjectTaskBoardItem>>;
1365
+ archiveTask: (itemId: string) => Promise<ApiResult<ProjectTaskBoardItem>>;
1366
+ unarchiveTask: (itemId: string) => Promise<ApiResult<ProjectTaskBoardItem>>;
1379
1367
  refetch: () => Promise<void>;
1380
1368
  };
1381
1369
 
@@ -1404,11 +1392,11 @@ export declare function useProjectThreads(projectId?: string, options?: {
1404
1392
  error: any;
1405
1393
  hasMore: boolean;
1406
1394
  nextCursor: string;
1407
- createThread: (request: CreateAgentThreadRequest) => Promise<AgentThread>;
1408
- createThreadForProject: (targetProjectId: string, request: CreateAgentThreadRequest) => Promise<AgentThread>;
1409
- updateThread: (threadId: string, request: UpdateAgentThreadRequest) => Promise<AgentThread>;
1410
- archiveThread: (threadId: string) => Promise<AgentThread>;
1411
- unarchiveThread: (threadId: string) => Promise<AgentThread>;
1395
+ createThread: (request: CreateAgentThreadRequest) => Promise<ApiResult<AgentThread>>;
1396
+ createThreadForProject: (targetProjectId: string, request: CreateAgentThreadRequest) => Promise<ApiResult<AgentThread>>;
1397
+ updateThread: (threadId: string, request: UpdateAgentThreadRequest) => Promise<ApiResult<AgentThread>>;
1398
+ archiveThread: (threadId: string) => Promise<ApiResult<AgentThread>>;
1399
+ unarchiveThread: (threadId: string) => Promise<ApiResult<AgentThread>>;
1412
1400
  refetch: () => Promise<void>;
1413
1401
  };
1414
1402
 
@@ -1430,8 +1418,6 @@ declare type UsernameSignInParams = {
1430
1418
  password: string;
1431
1419
  };
1432
1420
 
1433
- export declare function useScopeUnread(params?: NotificationListParams): UseScopeUnreadReturnType;
1434
-
1435
1421
  declare type UseScopeUnreadReturnType = {
1436
1422
  loading: true;
1437
1423
  count: number;
@@ -1486,32 +1472,6 @@ declare type UseSignInReturnType = {
1486
1472
  setSignInAttempt: (attempt: SigninAttempt | null) => void;
1487
1473
  };
1488
1474
 
1489
- export declare function useSignInWithStrategy<T extends SignInStrategy>(strategy: T): UseSignInWithStrategyReturnType<T>;
1490
-
1491
- export declare type UseSignInWithStrategyReturnType<T extends SignInStrategy> = {
1492
- loading: true;
1493
- signIn: never;
1494
- signinAttempt: null;
1495
- discardSignInAttempt: () => void;
1496
- setSignInAttempt: (attempt: SigninAttempt | null) => void;
1497
- } | {
1498
- loading: false;
1499
- signIn: {
1500
- create: SignInFunction<T>;
1501
- completeVerification: (verificationCode: string) => Promise<Session>;
1502
- prepareVerification: (params: VerificationParams) => Promise<ApiResult<PrepareVerificationResponse>>;
1503
- completeProfile: (data: ProfileCompletionData) => Promise<Session>;
1504
- identify: (identifier: string) => Promise<IdentifyResult>;
1505
- initEnterpriseSso: (connectionId: string, redirectUri?: string) => Promise<{
1506
- sso_url: string;
1507
- session: Session;
1508
- }>;
1509
- };
1510
- signinAttempt: SigninAttempt | null;
1511
- discardSignInAttempt: () => void;
1512
- setSignInAttempt: (attempt: SigninAttempt | null) => void;
1513
- };
1514
-
1515
1475
  export declare function useSignUp(): UseSignUpReturnType;
1516
1476
 
1517
1477
  export declare type UseSignUpReturnType = {
@@ -1608,7 +1568,7 @@ export declare function useUserSignins(): {
1608
1568
 
1609
1569
  export declare function useWaitlist(): {
1610
1570
  loading: boolean;
1611
- joinWaitlist: (params: WaitlistParams) => Promise<ApiResult<WaitlistResponse, ErrorInterface>>;
1571
+ joinWaitlist: (params: WaitlistParams) => Promise<ApiResult<WaitlistResponse>>;
1612
1572
  };
1613
1573
 
1614
1574
  export declare function useWebhookAnalytics(options?: UseWebhookAnalyticsOptions): UseWebhookAnalyticsReturn;
@@ -1631,17 +1591,17 @@ declare interface UseWebhookAppSessionResult {
1631
1591
  ticketExchanged: boolean;
1632
1592
  ticketLoading: boolean;
1633
1593
  refetch: () => Promise<void>;
1634
- createEndpoint: (options: CreateEndpointOptions) => Promise<EndpointWithSubscriptions>;
1635
- updateEndpoint: (endpointId: string, options: UpdateEndpointOptions) => Promise<EndpointWithSubscriptions>;
1636
- deleteEndpoint: (endpointId: string) => Promise<DeleteEndpointResponse>;
1637
- testEndpoint: (endpointId: string, options: TestEndpointOptions) => Promise<TestEndpointResponse>;
1638
- rotateSecret: () => Promise<WebhookAppInfo>;
1639
- updateSettings: (options: UpdateWebhookSettingsOptions) => Promise<WebhookSettingsResponse>;
1640
- replayDelivery: (options: ReplayWebhookDeliveryOptions) => Promise<ReplayWebhookDeliveryResponse>;
1641
- fetchReplayTaskStatus: (options: ReplayTaskStatusOptions) => Promise<ReplayTaskStatusResponse>;
1642
- fetchReplayTasks: (options?: ReplayTaskListOptions) => Promise<ReplayTaskListResponse>;
1643
- cancelReplayTask: (options: CancelReplayTaskOptions) => Promise<CancelReplayTaskResponse>;
1644
- fetchDeliveryDetail: (deliveryId: string) => Promise<WebhookDeliveryDetail[]>;
1594
+ createEndpoint: (options: CreateEndpointOptions) => Promise<ApiResult<EndpointWithSubscriptions>>;
1595
+ updateEndpoint: (endpointId: string, options: UpdateEndpointOptions) => Promise<ApiResult<EndpointWithSubscriptions>>;
1596
+ deleteEndpoint: (endpointId: string) => Promise<ApiResult<DeleteEndpointResponse>>;
1597
+ testEndpoint: (endpointId: string, options: TestEndpointOptions) => Promise<ApiResult<TestEndpointResponse>>;
1598
+ rotateSecret: () => Promise<ApiResult<WebhookAppInfo>>;
1599
+ updateSettings: (options: UpdateWebhookSettingsOptions) => Promise<ApiResult<WebhookSettingsResponse>>;
1600
+ replayDelivery: (options: ReplayWebhookDeliveryOptions) => Promise<ApiResult<ReplayWebhookDeliveryResponse>>;
1601
+ fetchReplayTaskStatus: (options: ReplayTaskStatusOptions) => Promise<ApiResult<ReplayTaskStatusResponse>>;
1602
+ fetchReplayTasks: (options?: ReplayTaskListOptions) => Promise<ApiResult<ReplayTaskListResponse>>;
1603
+ cancelReplayTask: (options: CancelReplayTaskOptions) => Promise<ApiResult<CancelReplayTaskResponse>>;
1604
+ fetchDeliveryDetail: (deliveryId: string) => Promise<ApiResult<WebhookDeliveryDetail[]>>;
1645
1605
  }
1646
1606
 
1647
1607
  export declare function useWebhookDeliveries(options?: UseWebhookDeliveriesOptions): {