Skip to content

Commit 030cb59

Browse files
committed
api comment fixes
1 parent fe45165 commit 030cb59

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

src/common/providers/identity.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -334,16 +334,20 @@ export interface Credential {
334334
signInMethod: string;
335335
}
336336

337-
/** Possible types of emails as described by the GCIP backend. */
337+
/**
338+
* Possible types of emails as described by the GCIP backend, which can be:
339+
* - An sign-in email
340+
* - A password reset email
341+
*/
338342
export type EmailType = "EMAIL_SIGN_IN" | "PASSWORD_RESET";
339343

340344
/**
341-
* The type of SMS message
345+
* The type of SMS message, which can be:
346+
* - A sign-in or sign up SMS message
347+
* - A multi-factor sign-in SMS message
348+
* - A multi-factor enrollment SMS message
342349
*/
343-
export type SmsType =
344-
| "SIGN_IN_OR_SIGN_UP" // A sign-in or sign up SMS message
345-
| "MULTI_FACTOR_SIGN_IN" // A multi-factor sign-in SMS message
346-
| "MULTI_FACTOR_ENROLLMENT"; // A multi-factor enrollment SMS message
350+
export type SmsType = "SIGN_IN_OR_SIGN_UP" | "MULTI_FACTOR_SIGN_IN" | "MULTI_FACTOR_ENROLLMENT";
347351

348352
/** Defines the auth event context for blocking events */
349353
export interface AuthEventContext extends EventContext {
@@ -374,7 +378,7 @@ export interface BeforeSmsResponse {
374378
recaptchaActionOverride?: RecaptchaActionOptions;
375379
}
376380

377-
/** The handler response type for beforeCreate blocking events */
381+
/** The handler response type for `beforeCreate` blocking events */
378382
export interface BeforeCreateResponse {
379383
displayName?: string;
380384
disabled?: boolean;
@@ -472,7 +476,7 @@ export interface DecodedPayload {
472476
* Internal definition to include all the fields that can be sent as
473477
* a response from the blocking function to the backend.
474478
* This is added mainly to have a type definition for 'generateResponsePayload'
475-
* @internal */
479+
@internal */
476480
export interface ResponsePayload {
477481
userRecord?: UserRecordResponsePayload;
478482
recaptchaActionOverride?: RecaptchaActionOptions;

src/v2/providers/identity.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -167,26 +167,26 @@ export interface BlockingOptions {
167167

168168
/**
169169
* Handles an event that is triggered before a user is created.
170-
* @param handler - Event handler which is run every time before a user is created
170+
* @param handler - Event handler which is run every time before a user is created.
171171
*/
172172
export function beforeUserCreated(
173173
handler: (event: AuthBlockingEvent) => MaybeAsync<BeforeCreateResponse | void>
174174
): BlockingFunction;
175175

176176
/**
177177
* Handles an event that is triggered before a user is created.
178-
* @param opts - Object containing function options
179-
* @param handler - Event handler which is run every time before a user is created
178+
* @param opts - Object containing function options.
179+
* @param handler - Event handler which is run every time before a user is created.
180180
*/
181181
export function beforeUserCreated(
182182
opts: BlockingOptions,
183183
handler: (event: AuthBlockingEvent) => MaybeAsync<BeforeCreateResponse | void>
184184
): BlockingFunction;
185185

186186
/**
187-
* Handles an event that is triggered before a user is created
188-
* @param optsOrHandler - Either an object containing function options, or an event handler (run before user creation)
189-
* @param handler? - If defined, an event handler which is run every time before a user is created
187+
* Handles an event that is triggered before a user is created.
188+
* @param optsOrHandler - Either an object containing function options, or an event handler (run before user creation).
189+
* @param handler? - If defined, an event handler which is run every time before a user is created.
190190
*/
191191
export function beforeUserCreated(
192192
optsOrHandler:
@@ -199,16 +199,16 @@ export function beforeUserCreated(
199199

200200
/**
201201
* Handles an event that is triggered before a user is signed in.
202-
* @param handler - Event handler which is run every time before a user is signed in
202+
* @param handler - Event handler which is run every time before a user is signed in.
203203
*/
204204
export function beforeUserSignedIn(
205205
handler: (event: AuthBlockingEvent) => MaybeAsync<BeforeSignInResponse | void>
206206
): BlockingFunction;
207207

208208
/**
209209
* Handles an event that is triggered before a user is signed in.
210-
* @param opts - Object containing function options
211-
* @param handler - Event handler which is run every time before a user is signed in
210+
* @param opts - Object containing function options.
211+
* @param handler - Event handler which is run every time before a user is signed in.
212212
*/
213213
export function beforeUserSignedIn(
214214
opts: BlockingOptions,
@@ -217,8 +217,8 @@ export function beforeUserSignedIn(
217217

218218
/**
219219
* Handles an event that is triggered before a user is signed in.
220-
* @param optsOrHandler - Either an object containing function options, or an event handler (run before user signin)
221-
* @param handler - Event handler which is run every time before a user is signed in
220+
* @param optsOrHandler - Either an object containing function options, or an event handler (run before user signin).
221+
* @param handler - Event handler which is run every time before a user is signed in.
222222
*/
223223
export function beforeUserSignedIn(
224224
optsOrHandler:
@@ -239,7 +239,7 @@ export function beforeEmailSent(
239239

240240
/**
241241
* Handles an event that is triggered before an email is sent to a user.
242-
* @param opts - Object containing function options
242+
* @param opts - Object containing function options.
243243
* @param handler - Event handler that is run before an email is sent to a user.
244244
*/
245245
export function beforeEmailSent(
@@ -270,7 +270,7 @@ export function beforeSmsSent(
270270

271271
/**
272272
* Handles an event that is triggered before an SMS is sent to a user.
273-
* @param opts - Object containing function options
273+
* @param opts - Object containing function options.
274274
* @param handler - Event handler that is run before an SMS is sent to a user.
275275
*/
276276
export function beforeSmsSent(
@@ -317,7 +317,6 @@ export function beforeOperation(
317317

318318
// Create our own function that just calls the provided function so we know for sure that
319319
// handler takes one argument. This is something common/providers/identity depends on.
320-
// const wrappedHandler = (event: AuthBlockingEvent) => handler(event);
321320
const annotatedHandler = Object.assign(handler, { platform: "gcfv2" as const });
322321
const func: any = wrapTraceContext(withInit(wrapHandler(eventType, annotatedHandler)));
323322

0 commit comments

Comments
 (0)