@pipedream/connect-react 1.0.0-preview.8 → 1.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.
- package/README.md +5 -0
- package/dist/connect-react.es.js +14057 -11453
- package/dist/connect-react.umd.d.ts +43 -16
- package/dist/connect-react.umd.js +18 -16
- package/package.json +4 -3
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AccountsRequestResponse } from '@pipedream/sdk';
|
|
2
|
-
import { AppRequestResponse } from '@pipedream/sdk';
|
|
3
2
|
import { AppResponse } from '@pipedream/sdk';
|
|
4
3
|
import { BrowserClient } from '@pipedream/sdk/browser';
|
|
5
4
|
import { ClassNamesConfig } from 'react-select';
|
|
@@ -16,6 +15,7 @@ import { CSSProperties } from 'react';
|
|
|
16
15
|
import { FC } from 'react';
|
|
17
16
|
import { FetchStatus } from '@tanstack/query-core';
|
|
18
17
|
import { GetAccountOpts } from '@pipedream/sdk';
|
|
18
|
+
import { GetAppResponse } from '@pipedream/sdk';
|
|
19
19
|
import { GetAppsOpts } from '@pipedream/sdk';
|
|
20
20
|
import { GetComponentOpts } from '@pipedream/sdk';
|
|
21
21
|
import { GroupBase } from 'react-select';
|
|
@@ -43,6 +43,10 @@ export declare type BaseReactSelectProps<Option, IsMulti extends boolean, Group
|
|
|
43
43
|
styles?: StylesConfig;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
declare type ButtonProps = {
|
|
47
|
+
onChange: () => void;
|
|
48
|
+
};
|
|
49
|
+
|
|
46
50
|
export declare type Colors = {
|
|
47
51
|
primary: string;
|
|
48
52
|
primary75: string;
|
|
@@ -79,7 +83,10 @@ declare type ComponentFormProps<T extends ConfigurableProps, U = ConfiguredProps
|
|
|
79
83
|
propNames?: string[];
|
|
80
84
|
onSubmit?: (ctx: FormContext<T>) => void | Promise<void>;
|
|
81
85
|
onUpdateConfiguredProps?: (v: U) => void;
|
|
86
|
+
onUpdateDynamicProps?: (dp: DynamicProps<T>) => void;
|
|
82
87
|
hideOptionalProps?: boolean;
|
|
88
|
+
sdkResponse?: unknown | undefined;
|
|
89
|
+
enableDebugging?: boolean;
|
|
83
90
|
};
|
|
84
91
|
|
|
85
92
|
export declare type ComponentLibrary = typeof defaultComponents;
|
|
@@ -103,7 +110,7 @@ declare type ControlProps<T extends ConfigurableProps, U extends ConfigurablePro
|
|
|
103
110
|
form: FormContext<T>;
|
|
104
111
|
};
|
|
105
112
|
|
|
106
|
-
export declare function ControlSelect<T>({ isCreatable, options, selectProps, }: ControlSelectProps<T>): JSX_2.Element;
|
|
113
|
+
export declare function ControlSelect<T>({ isCreatable, options, selectProps, showLoadMoreButton, onLoadMore, }: ControlSelectProps<T>): JSX_2.Element;
|
|
107
114
|
|
|
108
115
|
declare type ControlSelectProps<T> = {
|
|
109
116
|
isCreatable?: boolean;
|
|
@@ -112,6 +119,8 @@ declare type ControlSelectProps<T> = {
|
|
|
112
119
|
value: T;
|
|
113
120
|
}[];
|
|
114
121
|
selectProps?: Props;
|
|
122
|
+
showLoadMoreButton?: boolean;
|
|
123
|
+
onLoadMore?: () => void;
|
|
115
124
|
};
|
|
116
125
|
|
|
117
126
|
export declare function ControlSubmit(props: ControlSubmitProps): JSX_2.Element;
|
|
@@ -152,6 +161,7 @@ export declare type CustomizableProps = {
|
|
|
152
161
|
label: ComponentProps<typeof Label>;
|
|
153
162
|
optionalFields: ComponentProps<typeof ComponentForm>;
|
|
154
163
|
optionalFieldButton: ComponentProps<typeof OptionalFieldButton>;
|
|
164
|
+
loadMoreButton: ComponentProps<typeof LoadMoreButton>;
|
|
155
165
|
};
|
|
156
166
|
|
|
157
167
|
export declare type Customization = {
|
|
@@ -209,6 +219,7 @@ export declare const defaultComponents: {
|
|
|
209
219
|
Errors: typeof Errors;
|
|
210
220
|
Label: typeof Label;
|
|
211
221
|
OptionalFieldButton: (props: OptionalFieldButtonProps) => JSX_2.Element;
|
|
222
|
+
Button: (props: ButtonProps) => JSX_2.Element;
|
|
212
223
|
};
|
|
213
224
|
|
|
214
225
|
export declare const defaultTheme: Theme;
|
|
@@ -239,7 +250,6 @@ export declare class ErrorBoundary extends Component<Props_2> {
|
|
|
239
250
|
export declare function Errors<T extends ConfigurableProps, U extends ConfigurableProp>(props: ErrorsProps<T, U>): JSX_2.Element | null;
|
|
240
251
|
|
|
241
252
|
declare type ErrorsProps<T extends ConfigurableProps, U extends ConfigurableProp> = {
|
|
242
|
-
errors: string[];
|
|
243
253
|
field: FormFieldContext<U>;
|
|
244
254
|
form: FormContext<T>;
|
|
245
255
|
};
|
|
@@ -262,16 +272,22 @@ export declare type FormContext<T extends ConfigurableProps> = {
|
|
|
262
272
|
configuredProps: ConfiguredProps<T>;
|
|
263
273
|
dynamicProps?: DynamicProps<T>;
|
|
264
274
|
dynamicPropsQueryIsFetching?: boolean;
|
|
275
|
+
errors: Record<string, string[]>;
|
|
276
|
+
sdkErrors: SdkError[];
|
|
277
|
+
fields: Record<string, FormFieldContext<ConfigurableProp>>;
|
|
265
278
|
id: string;
|
|
266
279
|
isValid: boolean;
|
|
267
280
|
optionalPropIsEnabled: (prop: ConfigurableProp) => boolean;
|
|
268
281
|
optionalPropSetEnabled: (prop: ConfigurableProp, enabled: boolean) => void;
|
|
269
282
|
props: ComponentFormProps<T>;
|
|
283
|
+
propsNeedConfiguring: string[];
|
|
270
284
|
queryDisabledIdx?: number;
|
|
285
|
+
registerField: <T extends ConfigurableProp>(field: FormFieldContext<T>) => void;
|
|
271
286
|
setConfiguredProp: (idx: number, value: unknown) => void;
|
|
272
287
|
setSubmitting: (submitting: boolean) => void;
|
|
273
288
|
submitting: boolean;
|
|
274
289
|
userId: string;
|
|
290
|
+
enableDebugging?: boolean;
|
|
275
291
|
};
|
|
276
292
|
|
|
277
293
|
export declare const FormContext: Context<FormContext<any> | undefined>;
|
|
@@ -291,6 +307,8 @@ export declare type FormFieldContext<T extends ConfigurableProp> = {
|
|
|
291
307
|
value: PropValue<T["type"]> | undefined;
|
|
292
308
|
onChange: (value: PropValue<T["type"]> | undefined) => void;
|
|
293
309
|
extra: FormFieldContextExtra<T>;
|
|
310
|
+
errors: Record<string, string[]>;
|
|
311
|
+
enableDebugging?: boolean;
|
|
294
312
|
};
|
|
295
313
|
|
|
296
314
|
export declare const FormFieldContext: Context<FormFieldContext<any> | undefined>;
|
|
@@ -320,6 +338,8 @@ declare type LabelProps<T extends ConfigurableProps, U extends ConfigurableProp>
|
|
|
320
338
|
form: FormContext<T>;
|
|
321
339
|
};
|
|
322
340
|
|
|
341
|
+
declare const LoadMoreButton: (props: ButtonProps) => JSX_2.Element;
|
|
342
|
+
|
|
323
343
|
export declare function mergeTheme(target: Theme, ...sources: (PartialTheme | undefined)[]): Theme;
|
|
324
344
|
|
|
325
345
|
export declare const OptionalFieldButton: (props: OptionalFieldButtonProps) => JSX_2.Element;
|
|
@@ -353,6 +373,11 @@ declare type RemoteOptionsContainerProps = {
|
|
|
353
373
|
queryEnabled?: boolean;
|
|
354
374
|
};
|
|
355
375
|
|
|
376
|
+
declare type SdkError = {
|
|
377
|
+
name: string;
|
|
378
|
+
message: string;
|
|
379
|
+
};
|
|
380
|
+
|
|
356
381
|
export declare function SelectApp({ value, onChange, }: SelectAppProps): JSX_2.Element;
|
|
357
382
|
|
|
358
383
|
declare type SelectAppProps = {
|
|
@@ -382,6 +407,8 @@ export declare type Shadows = {
|
|
|
382
407
|
dropdown: string;
|
|
383
408
|
};
|
|
384
409
|
|
|
410
|
+
export declare const skippablePropTypes: string[];
|
|
411
|
+
|
|
385
412
|
export declare type Theme = {
|
|
386
413
|
borderRadius?: number | string;
|
|
387
414
|
colors: Partial<Colors>;
|
|
@@ -543,10 +570,10 @@ export declare const useAccounts: (input: GetAccountOpts, opts?: {
|
|
|
543
570
|
* Get details about an app
|
|
544
571
|
*/
|
|
545
572
|
export declare const useApp: (slug: string, opts?: {
|
|
546
|
-
useQueryOpts?: Omit<UseQueryOptions<
|
|
573
|
+
useQueryOpts?: Omit<UseQueryOptions<GetAppResponse>, "queryKey" | "queryFn">;
|
|
547
574
|
}) => {
|
|
548
575
|
app: any;
|
|
549
|
-
data:
|
|
576
|
+
data: GetAppResponse;
|
|
550
577
|
error: Error;
|
|
551
578
|
isError: true;
|
|
552
579
|
isPending: false;
|
|
@@ -568,12 +595,12 @@ export declare const useApp: (slug: string, opts?: {
|
|
|
568
595
|
isPlaceholderData: boolean;
|
|
569
596
|
isRefetching: boolean;
|
|
570
597
|
isStale: boolean;
|
|
571
|
-
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<
|
|
598
|
+
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetAppResponse, Error>>;
|
|
572
599
|
fetchStatus: FetchStatus;
|
|
573
|
-
promise: Promise<
|
|
600
|
+
promise: Promise<GetAppResponse>;
|
|
574
601
|
} | {
|
|
575
602
|
app: any;
|
|
576
|
-
data:
|
|
603
|
+
data: GetAppResponse;
|
|
577
604
|
error: null;
|
|
578
605
|
isError: false;
|
|
579
606
|
isPending: false;
|
|
@@ -595,9 +622,9 @@ export declare const useApp: (slug: string, opts?: {
|
|
|
595
622
|
isPlaceholderData: boolean;
|
|
596
623
|
isRefetching: boolean;
|
|
597
624
|
isStale: boolean;
|
|
598
|
-
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<
|
|
625
|
+
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetAppResponse, Error>>;
|
|
599
626
|
fetchStatus: FetchStatus;
|
|
600
|
-
promise: Promise<
|
|
627
|
+
promise: Promise<GetAppResponse>;
|
|
601
628
|
} | {
|
|
602
629
|
app: any;
|
|
603
630
|
data: undefined;
|
|
@@ -622,9 +649,9 @@ export declare const useApp: (slug: string, opts?: {
|
|
|
622
649
|
isPlaceholderData: boolean;
|
|
623
650
|
isRefetching: boolean;
|
|
624
651
|
isStale: boolean;
|
|
625
|
-
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<
|
|
652
|
+
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetAppResponse, Error>>;
|
|
626
653
|
fetchStatus: FetchStatus;
|
|
627
|
-
promise: Promise<
|
|
654
|
+
promise: Promise<GetAppResponse>;
|
|
628
655
|
} | {
|
|
629
656
|
app: any;
|
|
630
657
|
data: undefined;
|
|
@@ -649,9 +676,9 @@ export declare const useApp: (slug: string, opts?: {
|
|
|
649
676
|
isPlaceholderData: boolean;
|
|
650
677
|
isRefetching: boolean;
|
|
651
678
|
isStale: boolean;
|
|
652
|
-
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<
|
|
679
|
+
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetAppResponse, Error>>;
|
|
653
680
|
fetchStatus: FetchStatus;
|
|
654
|
-
promise: Promise<
|
|
681
|
+
promise: Promise<GetAppResponse>;
|
|
655
682
|
} | {
|
|
656
683
|
app: any;
|
|
657
684
|
data: undefined;
|
|
@@ -676,9 +703,9 @@ export declare const useApp: (slug: string, opts?: {
|
|
|
676
703
|
isPlaceholderData: boolean;
|
|
677
704
|
isRefetching: boolean;
|
|
678
705
|
isStale: boolean;
|
|
679
|
-
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<
|
|
706
|
+
refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetAppResponse, Error>>;
|
|
680
707
|
fetchStatus: FetchStatus;
|
|
681
|
-
promise: Promise<
|
|
708
|
+
promise: Promise<GetAppResponse>;
|
|
682
709
|
};
|
|
683
710
|
|
|
684
711
|
/**
|