authhero 0.81.0 → 0.83.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.
@@ -4657,11 +4657,12 @@ export interface DataAdapters {
4657
4657
  themes: ThemesAdapter;
4658
4658
  users: UserDataAdapter;
4659
4659
  }
4660
- export type OnExecuteCredentialsExchangeEvent = {
4661
- client: Client;
4660
+ export type HookEvent = {
4661
+ client?: Client;
4662
+ request: Request;
4662
4663
  user?: User;
4663
- scope: string;
4664
- grant_type: string;
4664
+ scope?: string;
4665
+ grant_type?: string;
4665
4666
  audience?: string;
4666
4667
  };
4667
4668
  export type OnExecuteCredentialsExchangeAPI = {
@@ -4675,7 +4676,17 @@ export type OnExecuteCredentialsExchangeAPI = {
4675
4676
  deny: (code: string, reason?: string) => void;
4676
4677
  };
4677
4678
  };
4678
- export type OnExecuteCredentialsExchange = (event: OnExecuteCredentialsExchangeEvent, access: OnExecuteCredentialsExchangeAPI) => Promise<void>;
4679
+ export type OnExecuteCredentialsExchange = (event: HookEvent, access: OnExecuteCredentialsExchangeAPI) => Promise<void>;
4680
+ export type OnExecutePreUserRegistrationAPI = {
4681
+ user: {
4682
+ setUserMetadata: (key: string, value: any) => void;
4683
+ };
4684
+ };
4685
+ export type OnExecutePostUserRegistrationAPI = {
4686
+ user: {};
4687
+ };
4688
+ export type OnExecutePreUserRegistration = (event: HookEvent, api: OnExecutePreUserRegistrationAPI) => Promise<void>;
4689
+ export type OnExecutePostUserRegistration = (event: HookEvent, api: OnExecutePostUserRegistrationAPI) => Promise<void>;
4679
4690
  export type SendEmailParams = {
4680
4691
  emailProvider: EmailProvider;
4681
4692
  to: string;
@@ -4723,6 +4734,8 @@ export type Bindings = {
4723
4734
  data: DataAdapters;
4724
4735
  hooks?: {
4725
4736
  onExecuteCredentialsExchange?: OnExecuteCredentialsExchange;
4737
+ onExecutePreUserRegistration?: OnExecutePreUserRegistration;
4738
+ onExecutePostUserRegistration?: OnExecutePostUserRegistration;
4726
4739
  };
4727
4740
  emailProviders?: {
4728
4741
  [key: string]: EmailService;