@dev-fastn-ai/react-core 2.0.0 → 2.0.1

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.
@@ -1,3 +1,4 @@
1
+ import { ConnectorActionResult } from "../types";
1
2
  /**
2
3
  * Input for activating a connector, including dependency, auth method, and form data.
3
4
  */
@@ -17,10 +18,7 @@ export declare const activateConnector: ({ connectorId, action, dependencyConnec
17
18
  dependencyConnector: any;
18
19
  authMethod: any;
19
20
  input?: any;
20
- }) => Promise<{
21
- data: any;
22
- status: string;
23
- }>;
21
+ }) => Promise<ConnectorActionResult>;
24
22
  /**
25
23
  * Framework-agnostic deactivateConnector utility.
26
24
  * @param args - Deactivation arguments (connectorId, action, deactivateConnectorFn, executeActionHandlerFn, config)
@@ -13,7 +13,7 @@ export declare function refreshOptions(pagination: SelectOptionsResultPagination
13
13
  /**
14
14
  * Gets options for a select field.
15
15
  */
16
- export declare function getOptions(pagination: SelectOptionsResultPagination, context?: FormData): Promise<OptionsResult>;
16
+ export declare function getOptions(pagination: SelectOptionsResultPagination, context?: FormData, query?: string): Promise<OptionsResult>;
17
17
  /**
18
18
  * Searches options for a select field.
19
19
  */
@@ -1,4 +1,4 @@
1
- export * from './config';
1
+ export * from "./config";
2
2
  /**
3
3
  * Represents a standardized error for Fastn operations.
4
4
  */
@@ -146,6 +146,7 @@ export interface SelectOptionsResultPagination {
146
146
  readonly sourceId: string;
147
147
  readonly sourceProject: string;
148
148
  readonly limit?: number;
149
+ readonly query?: string;
149
150
  readonly offset?: number;
150
151
  readonly cursor?: string;
151
152
  readonly type: "OFFSET" | "CURSOR";
@@ -177,7 +178,7 @@ export interface SelectOptionSource {
177
178
  readonly staticOptions?: readonly SelectOption[];
178
179
  readonly pagination?: SelectOptionsResultPagination;
179
180
  readonly searchOptions?: (query: string, pagination: SelectOptionsResultPagination, context?: FormData) => Promise<OptionsResult>;
180
- readonly getOptions?: (pagination: SelectOptionsResultPagination, context?: FormData) => Promise<OptionsResult>;
181
+ readonly getOptions?: (pagination: SelectOptionsResultPagination, context?: FormData, query?: string) => Promise<OptionsResult>;
181
182
  readonly loadMore?: (pagination: SelectOptionsResultPagination, context?: FormData) => Promise<OptionsResult>;
182
183
  readonly refresh?: (pagination: SelectOptionsResultPagination, context?: FormData) => Promise<OptionsResult>;
183
184
  }
@@ -211,8 +212,8 @@ export interface ConnectorForm {
211
212
  readonly submitButtonLabel?: string;
212
213
  }
213
214
  export interface ConnectorActionResult {
214
- readonly data: Record<string, Primitive> | Record<string, Primitive>[] | undefined | null;
215
- readonly status: "SUCCESS" | "ERROR";
215
+ readonly data?: Record<string, Primitive> | Record<string, Primitive>[] | undefined | null | null;
216
+ readonly status: "SUCCESS" | "ERROR" | "CANCELLED";
216
217
  }
217
218
  /**
218
219
  * Represents an action available on a connector.