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