@saas-support/react 0.7.3 → 0.7.6

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/react.d.ts CHANGED
@@ -27,8 +27,10 @@ declare class AuthClient {
27
27
  private cachedUser;
28
28
  private cachedSettings;
29
29
  private loaded;
30
+ private loadPromise;
30
31
  constructor(transport: Transport, tokenManager: TokenManager | null, emitter: EventEmitter<SaaSEvents>, baseUrl: string);
31
32
  load(): Promise<void>;
33
+ private doLoad;
32
34
  signIn(email: string, password: string): Promise<AuthResult>;
33
35
  signUp(email: string, password: string): Promise<SignUpResult>;
34
36
  signOut(): Promise<void>;
@@ -78,6 +80,12 @@ declare class AuthClient {
78
80
  }>;
79
81
  listInvites(orgId: string): Promise<PendingInvite[]>;
80
82
  revokeInvite(orgId: string, inviteId: string): Promise<void>;
83
+ listMyInvites(): Promise<MyPendingInvite[]>;
84
+ acceptInviteById(inviteId: string): Promise<{
85
+ orgId: string;
86
+ role: string;
87
+ }>;
88
+ declineInvite(inviteId: string): Promise<void>;
81
89
  deleteAccount(): Promise<void>;
82
90
  /* Excluded from this release type: handleExternalLogout */
83
91
  /* Excluded from this release type: performRefresh */
@@ -325,6 +333,15 @@ declare interface MfaVerifyResult {
325
333
  backupCodes: string[];
326
334
  }
327
335
 
336
+ export declare interface MyPendingInvite {
337
+ id: string;
338
+ orgId: string;
339
+ orgName: string;
340
+ role: string;
341
+ expiresAt: string;
342
+ createdAt: string;
343
+ }
344
+
328
345
  export declare type OAuthProvider = 'google' | 'github';
329
346
 
330
347
  declare interface OffsetPage<T> {
@@ -543,6 +560,7 @@ export declare class SaaSSupport {
543
560
  private tokenManager;
544
561
  private emitter;
545
562
  private loaded;
563
+ private loadPromise;
546
564
  constructor(options: SaaSOptions);
547
565
  load(): Promise<void>;
548
566
  isLoaded(): boolean;
@@ -569,15 +587,17 @@ export declare interface SavedQueryListProps {
569
587
  appearance?: Appearance;
570
588
  }
571
589
 
572
- export declare function SettingsPanel({ onClose, afterDeleteAccountUrl, defaultTab }: SettingsPanelProps): JSX_2.Element;
590
+ export declare function SettingsPanel({ onClose, afterDeleteAccountUrl, defaultTab, onOrgDeleted, onOrgUpdated }: SettingsPanelProps): JSX_2.Element;
573
591
 
574
592
  export declare interface SettingsPanelProps {
575
593
  onClose: () => void;
576
594
  afterDeleteAccountUrl?: string;
577
595
  defaultTab?: SettingsTab;
596
+ onOrgDeleted?: () => void;
597
+ onOrgUpdated?: () => void;
578
598
  }
579
599
 
580
- declare type SettingsTab = 'profile' | 'organization' | 'people' | 'billing';
600
+ declare type SettingsTab = 'profile' | 'organization' | 'people' | 'invites' | 'billing';
581
601
 
582
602
  export declare function SignIn({ appearance: localAppearance, signUpUrl, onSignUp }: SignInProps): JSX_2.Element;
583
603
 
@@ -753,6 +773,19 @@ export declare function useEmbedDashboard(embedToken: string, dashboardId: strin
753
773
  refresh: () => Promise<void>;
754
774
  };
755
775
 
776
+ export declare function useInvites(): {
777
+ invites: MyPendingInvite[];
778
+ isLoading: boolean;
779
+ error: string | null;
780
+ setError: Dispatch<SetStateAction<string | null>>;
781
+ refresh: () => Promise<void>;
782
+ accept: (inviteId: string) => Promise<{
783
+ orgId: string;
784
+ role: string;
785
+ } | null>;
786
+ decline: (inviteId: string) => Promise<boolean>;
787
+ };
788
+
756
789
  export declare function useInvoices(customerId: string, portalToken?: string): {
757
790
  invoices: Invoice[];
758
791
  isLoading: boolean;