@pipedream/connect-react 1.0.0-preview.9 → 1.0.2

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,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';
@@ -38,16 +38,15 @@ declare type AlertProps = {
38
38
  prop: ConfigurablePropAlert;
39
39
  };
40
40
 
41
- export declare function appPropError(opts: {
42
- value: any;
43
- app: AppResponse | undefined;
44
- }): string | undefined;
45
-
46
41
  export declare type BaseReactSelectProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = {
47
42
  components?: SelectComponentsConfig<Option, IsMulti, Group>;
48
43
  styles?: StylesConfig;
49
44
  };
50
45
 
46
+ declare type ButtonProps = {
47
+ onChange: () => void;
48
+ };
49
+
51
50
  export declare type Colors = {
52
51
  primary: string;
53
52
  primary75: string;
@@ -84,7 +83,10 @@ declare type ComponentFormProps<T extends ConfigurableProps, U = ConfiguredProps
84
83
  propNames?: string[];
85
84
  onSubmit?: (ctx: FormContext<T>) => void | Promise<void>;
86
85
  onUpdateConfiguredProps?: (v: U) => void;
86
+ onUpdateDynamicProps?: (dp: DynamicProps<T>) => void;
87
87
  hideOptionalProps?: boolean;
88
+ sdkResponse?: unknown | undefined;
89
+ enableDebugging?: boolean;
88
90
  };
89
91
 
90
92
  export declare type ComponentLibrary = typeof defaultComponents;
@@ -108,7 +110,7 @@ declare type ControlProps<T extends ConfigurableProps, U extends ConfigurablePro
108
110
  form: FormContext<T>;
109
111
  };
110
112
 
111
- 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;
112
114
 
113
115
  declare type ControlSelectProps<T> = {
114
116
  isCreatable?: boolean;
@@ -117,6 +119,8 @@ declare type ControlSelectProps<T> = {
117
119
  value: T;
118
120
  }[];
119
121
  selectProps?: Props;
122
+ showLoadMoreButton?: boolean;
123
+ onLoadMore?: () => void;
120
124
  };
121
125
 
122
126
  export declare function ControlSubmit(props: ControlSubmitProps): JSX_2.Element;
@@ -157,6 +161,7 @@ export declare type CustomizableProps = {
157
161
  label: ComponentProps<typeof Label>;
158
162
  optionalFields: ComponentProps<typeof ComponentForm>;
159
163
  optionalFieldButton: ComponentProps<typeof OptionalFieldButton>;
164
+ loadMoreButton: ComponentProps<typeof LoadMoreButton>;
160
165
  };
161
166
 
162
167
  export declare type Customization = {
@@ -214,6 +219,7 @@ export declare const defaultComponents: {
214
219
  Errors: typeof Errors;
215
220
  Label: typeof Label;
216
221
  OptionalFieldButton: (props: OptionalFieldButtonProps) => JSX_2.Element;
222
+ Button: (props: ButtonProps) => JSX_2.Element;
217
223
  };
218
224
 
219
225
  export declare const defaultTheme: Theme;
@@ -244,7 +250,6 @@ export declare class ErrorBoundary extends Component<Props_2> {
244
250
  export declare function Errors<T extends ConfigurableProps, U extends ConfigurableProp>(props: ErrorsProps<T, U>): JSX_2.Element | null;
245
251
 
246
252
  declare type ErrorsProps<T extends ConfigurableProps, U extends ConfigurableProp> = {
247
- errors: string[];
248
253
  field: FormFieldContext<U>;
249
254
  form: FormContext<T>;
250
255
  };
@@ -267,6 +272,8 @@ export declare type FormContext<T extends ConfigurableProps> = {
267
272
  configuredProps: ConfiguredProps<T>;
268
273
  dynamicProps?: DynamicProps<T>;
269
274
  dynamicPropsQueryIsFetching?: boolean;
275
+ errors: Record<string, string[]>;
276
+ sdkErrors: SdkError[];
270
277
  fields: Record<string, FormFieldContext<ConfigurableProp>>;
271
278
  id: string;
272
279
  isValid: boolean;
@@ -280,6 +287,7 @@ export declare type FormContext<T extends ConfigurableProps> = {
280
287
  setSubmitting: (submitting: boolean) => void;
281
288
  submitting: boolean;
282
289
  userId: string;
290
+ enableDebugging?: boolean;
283
291
  };
284
292
 
285
293
  export declare const FormContext: Context<FormContext<any> | undefined>;
@@ -299,6 +307,8 @@ export declare type FormFieldContext<T extends ConfigurableProp> = {
299
307
  value: PropValue<T["type"]> | undefined;
300
308
  onChange: (value: PropValue<T["type"]> | undefined) => void;
301
309
  extra: FormFieldContextExtra<T>;
310
+ errors: Record<string, string[]>;
311
+ enableDebugging?: boolean;
302
312
  };
303
313
 
304
314
  export declare const FormFieldContext: Context<FormFieldContext<any> | undefined>;
@@ -328,6 +338,8 @@ declare type LabelProps<T extends ConfigurableProps, U extends ConfigurableProp>
328
338
  form: FormContext<T>;
329
339
  };
330
340
 
341
+ declare const LoadMoreButton: (props: ButtonProps) => JSX_2.Element;
342
+
331
343
  export declare function mergeTheme(target: Theme, ...sources: (PartialTheme | undefined)[]): Theme;
332
344
 
333
345
  export declare const OptionalFieldButton: (props: OptionalFieldButtonProps) => JSX_2.Element;
@@ -361,6 +373,11 @@ declare type RemoteOptionsContainerProps = {
361
373
  queryEnabled?: boolean;
362
374
  };
363
375
 
376
+ declare type SdkError = {
377
+ name: string;
378
+ message: string;
379
+ };
380
+
364
381
  export declare function SelectApp({ value, onChange, }: SelectAppProps): JSX_2.Element;
365
382
 
366
383
  declare type SelectAppProps = {
@@ -390,6 +407,8 @@ export declare type Shadows = {
390
407
  dropdown: string;
391
408
  };
392
409
 
410
+ export declare const skippablePropTypes: string[];
411
+
393
412
  export declare type Theme = {
394
413
  borderRadius?: number | string;
395
414
  colors: Partial<Colors>;
@@ -551,10 +570,10 @@ export declare const useAccounts: (input: GetAccountOpts, opts?: {
551
570
  * Get details about an app
552
571
  */
553
572
  export declare const useApp: (slug: string, opts?: {
554
- useQueryOpts?: Omit<UseQueryOptions<AppRequestResponse>, "queryKey" | "queryFn">;
573
+ useQueryOpts?: Omit<UseQueryOptions<GetAppResponse>, "queryKey" | "queryFn">;
555
574
  }) => {
556
575
  app: any;
557
- data: AppRequestResponse;
576
+ data: GetAppResponse;
558
577
  error: Error;
559
578
  isError: true;
560
579
  isPending: false;
@@ -576,12 +595,12 @@ export declare const useApp: (slug: string, opts?: {
576
595
  isPlaceholderData: boolean;
577
596
  isRefetching: boolean;
578
597
  isStale: boolean;
579
- refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<AppRequestResponse, Error>>;
598
+ refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetAppResponse, Error>>;
580
599
  fetchStatus: FetchStatus;
581
- promise: Promise<AppRequestResponse>;
600
+ promise: Promise<GetAppResponse>;
582
601
  } | {
583
602
  app: any;
584
- data: AppRequestResponse;
603
+ data: GetAppResponse;
585
604
  error: null;
586
605
  isError: false;
587
606
  isPending: false;
@@ -603,9 +622,9 @@ export declare const useApp: (slug: string, opts?: {
603
622
  isPlaceholderData: boolean;
604
623
  isRefetching: boolean;
605
624
  isStale: boolean;
606
- refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<AppRequestResponse, Error>>;
625
+ refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetAppResponse, Error>>;
607
626
  fetchStatus: FetchStatus;
608
- promise: Promise<AppRequestResponse>;
627
+ promise: Promise<GetAppResponse>;
609
628
  } | {
610
629
  app: any;
611
630
  data: undefined;
@@ -630,9 +649,9 @@ export declare const useApp: (slug: string, opts?: {
630
649
  isPlaceholderData: boolean;
631
650
  isRefetching: boolean;
632
651
  isStale: boolean;
633
- refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<AppRequestResponse, Error>>;
652
+ refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetAppResponse, Error>>;
634
653
  fetchStatus: FetchStatus;
635
- promise: Promise<AppRequestResponse>;
654
+ promise: Promise<GetAppResponse>;
636
655
  } | {
637
656
  app: any;
638
657
  data: undefined;
@@ -657,9 +676,9 @@ export declare const useApp: (slug: string, opts?: {
657
676
  isPlaceholderData: boolean;
658
677
  isRefetching: boolean;
659
678
  isStale: boolean;
660
- refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<AppRequestResponse, Error>>;
679
+ refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetAppResponse, Error>>;
661
680
  fetchStatus: FetchStatus;
662
- promise: Promise<AppRequestResponse>;
681
+ promise: Promise<GetAppResponse>;
663
682
  } | {
664
683
  app: any;
665
684
  data: undefined;
@@ -684,9 +703,9 @@ export declare const useApp: (slug: string, opts?: {
684
703
  isPlaceholderData: boolean;
685
704
  isRefetching: boolean;
686
705
  isStale: boolean;
687
- refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<AppRequestResponse, Error>>;
706
+ refetch: (options?: RefetchOptions) => Promise<QueryObserverResult<GetAppResponse, Error>>;
688
707
  fetchStatus: FetchStatus;
689
- promise: Promise<AppRequestResponse>;
708
+ promise: Promise<GetAppResponse>;
690
709
  };
691
710
 
692
711
  /**