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

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.
@@ -8,7 +8,7 @@ export interface FastnError extends Error {
8
8
  /** Optional HTTP status code. */
9
9
  statusCode?: number;
10
10
  /** Additional error details. */
11
- details?: unknown;
11
+ details?: Record<string, Primitive> | Record<string, Primitive>[];
12
12
  }
13
13
  /**
14
14
  * Supported field types for connector forms.
@@ -119,7 +119,7 @@ export interface Configuration {
119
119
  readonly imageUri: string;
120
120
  readonly status: string;
121
121
  readonly actions: readonly ConfigurationAction[];
122
- readonly metadata?: unknown;
122
+ readonly metadata?: Record<string, Record<string, Primitive> | Record<string, Primitive>[] | undefined | null> | Record<string, Record<string, Primitive> | Record<string, Primitive>[] | undefined | null>[] | undefined | null;
123
123
  }
124
124
  export type Event = "REFETCH_CONNECTORS" | "REFETCH_CONFIGURATIONS" | "REFRESH_CONFIGURATION_FORM" | "INVALIDATE_CONFIGURATION_FORM" | "INVALIDATE_CONFIGURATIONS" | "INVALIDATE_CONNECTORS";
125
125
  /**
@@ -130,7 +130,7 @@ export interface ConfigurationAction {
130
130
  readonly actionType: ConfigurationActionType;
131
131
  readonly onClick?: () => Promise<ConnectorActionResult>;
132
132
  readonly form?: ConnectorForm | null;
133
- readonly onSubmit?: (formData: unknown) => Promise<ConnectorActionResult>;
133
+ readonly onSubmit?: (formData: Record<string, Primitive>) => Promise<ConnectorActionResult>;
134
134
  }
135
135
  /**
136
136
  * Represents a selectable option in a dropdown or select field.
@@ -156,11 +156,11 @@ export interface SelectOptionsResultPagination {
156
156
  /**
157
157
  * Primitive types allowed in form data.
158
158
  */
159
- type Primitive = string | number | boolean | null | undefined;
159
+ export type Primitive = string | number | boolean | null | undefined;
160
160
  /**
161
161
  * Represents form data as a record of values.
162
162
  */
163
- export type FormData = Record<string, Primitive | Primitive[] | Record<string, Primitive> | Record<string, Primitive>[]>;
163
+ export type FormData = Record<string, Record<string, Primitive> | Record<string, Primitive>[] | undefined | null> | Record<string, Record<string, Primitive> | Record<string, Primitive>[] | undefined | null>[] | undefined | null;
164
164
  /**
165
165
  * Result of loading options for a select field.
166
166
  */
@@ -211,7 +211,7 @@ export interface ConnectorForm {
211
211
  readonly submitButtonLabel?: string;
212
212
  }
213
213
  export interface ConnectorActionResult {
214
- readonly data: unknown;
214
+ readonly data: Record<string, Primitive> | Record<string, Primitive>[] | undefined | null;
215
215
  readonly status: "SUCCESS" | "ERROR";
216
216
  }
217
217
  /**
@@ -221,8 +221,8 @@ export interface ConnectorAction {
221
221
  readonly name: string;
222
222
  readonly actionType: ConnectorActionType | string;
223
223
  readonly form?: ConnectorForm | null;
224
- readonly onClick?: (data?: unknown) => Promise<ConnectorActionResult>;
225
- readonly onSubmit?: (formData: Record<string, unknown>) => Promise<ConnectorActionResult>;
224
+ readonly onClick?: () => Promise<ConnectorActionResult>;
225
+ readonly onSubmit?: (formData: Record<string, Primitive>) => Promise<ConnectorActionResult>;
226
226
  }
227
227
  /**
228
228
  * Represents a connector (integration) instance.
@@ -1,9 +1,9 @@
1
- import type { FastnError as FastnErrorType } from '../types';
1
+ import type { FastnError as FastnErrorType, Primitive } from '../types';
2
2
  export declare class FastnError extends Error implements FastnErrorType {
3
3
  code: string;
4
4
  statusCode?: number;
5
- details?: any;
6
- constructor(message: string, code: string, statusCode?: number, details?: any);
5
+ details?: Record<string, Primitive> | Record<string, Primitive>[];
6
+ constructor(message: string, code: string, statusCode?: number, details?: Record<string, Primitive> | Record<string, Primitive>[]);
7
7
  }
8
8
  export declare class MissingConfigError extends FastnError {
9
9
  constructor(message?: string, details?: any);
@@ -1,5 +1,6 @@
1
1
  import { ConnectorField, ConnectorFieldType, ConnectorForm, CustomAuthContext, OpenGoogleFilesPickerArgs, OptionsResult, SelectOptionsResultPagination } from "../types";
2
- export declare const getCustomAuthContext: (options?: RequestInit) => CustomAuthContext;
2
+ export declare const getCustomAuthContextValue: (operationName: string, variables: Record<string, any>) => string;
3
+ export declare const getCustomAuthContext: (operationName: string, input: Record<string, any>) => CustomAuthContext;
3
4
  export declare const addCustomAuthContextHeader: (headers: Record<string, string>, context: CustomAuthContext) => Record<string, string>;
4
5
  export declare const getOauthPopUpDimensions: () => {
5
6
  width: number;