Skip to content

Commit 00fc8cb

Browse files
authored
chore(*): Add jsdocs
2 parents 5dc79b4 + ed1d6b1 commit 00fc8cb

File tree

169 files changed

+3132
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+3132
-7
lines changed

eslint.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/**
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
/* eslint-disable @typescript-eslint/no-explicit-any */
218

319
import js from "@eslint/js";

packages/angular/jest.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/**
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
import type { Config } from "jest";
218
import { createCjsPreset } from "jest-preset-angular/presets/index.js";
319

packages/angular/src/lib/auth/forms/email-link-auth-form.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ import { injectEmailLinkAuthFormSchema, injectTranslation, injectUI } from "../.
6464
}
6565
`,
6666
})
67+
/**
68+
* A form component for email link authentication.
69+
*
70+
* Sends a sign-in link to the user's email address and automatically completes sign-in
71+
* if the user arrives via an email link.
72+
*/
6773
export class EmailLinkAuthFormComponent {
6874
private ui = injectUI();
6975
private formSchema = injectEmailLinkAuthFormSchema();
@@ -75,7 +81,9 @@ export class EmailLinkAuthFormComponent {
7581
emailSentMessage = injectTranslation("messages", "signInLinkSent");
7682
unknownErrorLabel = injectTranslation("errors", "unknownError");
7783

84+
/** Event emitter fired when sign-in link email is sent. */
7885
@Output() emailSent = new EventEmitter<void>();
86+
/** Event emitter for successful sign-in. */
7987
@Output() signIn = new EventEmitter<UserCredential>();
8088

8189
form = injectForm({

packages/angular/src/lib/auth/forms/forgot-password-auth-form.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ import { injectForgotPasswordAuthFormSchema, injectTranslation, injectUI } from
7373
}
7474
`,
7575
})
76+
/**
77+
* A form component for requesting a password reset email.
78+
*
79+
* Displays a success message after the email is sent.
80+
*/
7681
export class ForgotPasswordAuthFormComponent {
7782
private ui = injectUI();
7883
private formSchema = injectForgotPasswordAuthFormSchema();
@@ -85,8 +90,10 @@ export class ForgotPasswordAuthFormComponent {
8590
checkEmailForResetMessage = injectTranslation("messages", "checkEmailForReset");
8691
unknownErrorLabel = injectTranslation("errors", "unknownError");
8792

93+
/** Event emitter for back to sign in action. */
8894
backToSignIn = input<EventEmitter<void>>();
8995

96+
/** Event emitter fired when password reset email is sent. */
9097
@Output() passwordSent = new EventEmitter<void>();
9198

9299
form = injectForm({

packages/angular/src/lib/auth/forms/mfa/sms-multi-factor-assertion-form.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,15 @@ type PhoneMultiFactorInfo = MultiFactorInfo & {
6363
</form>
6464
`,
6565
})
66+
/**
67+
* A form component for requesting SMS verification code during MFA assertion.
68+
*/
6669
export class SmsMultiFactorAssertionPhoneFormComponent {
6770
private ui = injectUI();
6871

72+
/** The multi-factor info hint containing phone number details. */
6973
hint = input.required<MultiFactorInfo>();
74+
/** Event emitter fired when verification ID is received. */
7075
@Output() onSubmit = new EventEmitter<string>();
7176

7277
sendCodeLabel = injectTranslation("labels", "sendCode");
@@ -164,11 +169,16 @@ export class SmsMultiFactorAssertionPhoneFormComponent {
164169
</form>
165170
`,
166171
})
172+
/**
173+
* A form component for verifying SMS code during MFA assertion.
174+
*/
167175
export class SmsMultiFactorAssertionVerifyFormComponent {
168176
private ui = injectUI();
169177
private formSchema = injectMultiFactorPhoneAuthVerifyFormSchema();
170178

179+
/** The verification ID received from the phone form. */
171180
verificationId = input.required<string>();
181+
/** Event emitter for successful MFA assertion. */
172182
@Output() onSuccess = new EventEmitter<UserCredential>();
173183

174184
verificationCodeLabel = injectTranslation("labels", "verificationCode");
@@ -238,8 +248,15 @@ export class SmsMultiFactorAssertionVerifyFormComponent {
238248
</div>
239249
`,
240250
})
251+
/**
252+
* A form component for SMS multi-factor authentication assertion.
253+
*
254+
* Manages the flow between requesting and verifying SMS codes for MFA.
255+
*/
241256
export class SmsMultiFactorAssertionFormComponent {
257+
/** The multi-factor info hint containing phone number details. */
242258
hint = input.required<MultiFactorInfo>();
259+
/** Event emitter for successful MFA assertion. */
243260
@Output() onSuccess = new EventEmitter<UserCredential>();
244261

245262
verification = signal<{ verificationId: string } | null>(null);

packages/angular/src/lib/auth/forms/mfa/sms-multi-factor-enrollment-form.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ import {
111111
</div>
112112
`,
113113
})
114+
/**
115+
* A form component for SMS multi-factor authentication enrollment.
116+
*
117+
* Manages the flow between phone number entry and verification code entry for MFA enrollment.
118+
*/
114119
export class SmsMultiFactorEnrollmentFormComponent {
115120
private ui = injectUI();
116121
private phoneFormSchema = injectMultiFactorPhoneAuthNumberFormSchema();
@@ -128,6 +133,7 @@ export class SmsMultiFactorEnrollmentFormComponent {
128133
verifyCodeLabel = injectTranslation("labels", "verifyCode");
129134
smsVerificationPrompt = injectTranslation("prompts", "smsVerificationPrompt");
130135

136+
/** Event emitter fired when MFA enrollment is completed. */
131137
@Output() onEnrollment = new EventEmitter<void>();
132138

133139
recaptchaContainer = viewChild.required<ElementRef<HTMLDivElement>>("recaptchaContainer");

packages/angular/src/lib/auth/forms/mfa/totp-multi-factor-assertion-form.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,18 @@ import { TotpMultiFactorGenerator, type MultiFactorInfo, type UserCredential } f
5858
</form>
5959
`,
6060
})
61+
/**
62+
* A form component for TOTP multi-factor authentication assertion.
63+
*
64+
* Allows users to enter a TOTP code from their authenticator app.
65+
*/
6166
export class TotpMultiFactorAssertionFormComponent {
6267
private ui = injectUI();
6368
private formSchema = injectMultiFactorTotpAuthVerifyFormSchema();
6469

70+
/** The multi-factor info hint containing TOTP details. */
6571
hint = input.required<MultiFactorInfo>();
72+
/** Event emitter for successful MFA assertion. */
6673
@Output() onSuccess = new EventEmitter<UserCredential>();
6774

6875
verificationCodeLabel = injectTranslation("labels", "verificationCode");

packages/angular/src/lib/auth/forms/mfa/totp-multi-factor-enrollment-form.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,14 @@ import {
6666
</form>
6767
`,
6868
})
69+
/**
70+
* A form component for generating a TOTP secret and display name during MFA enrollment.
71+
*/
6972
export class TotpMultiFactorSecretGenerationFormComponent {
7073
private ui = injectUI();
7174
private formSchema = injectMultiFactorTotpAuthNumberFormSchema();
7275

76+
/** Event emitter fired when TOTP secret is generated. */
7377
@Output() onSubmit = new EventEmitter<{ secret: TotpSecret; displayName: string }>();
7478

7579
displayNameLabel = injectTranslation("labels", "displayName");
@@ -150,12 +154,20 @@ export class TotpMultiFactorSecretGenerationFormComponent {
150154
</form>
151155
`,
152156
})
157+
/**
158+
* A form component for verifying TOTP code during MFA enrollment.
159+
*
160+
* Displays a QR code and allows users to verify their authenticator app setup.
161+
*/
153162
export class TotpMultiFactorVerificationFormComponent {
154163
private ui = injectUI();
155164
private formSchema = injectMultiFactorTotpAuthVerifyFormSchema();
156165

166+
/** The TOTP secret generated in the previous step. */
157167
secret = input.required<TotpSecret>();
168+
/** The display name for the TOTP factor. */
158169
displayName = input.required<string>();
170+
/** Event emitter fired when MFA enrollment is completed. */
159171
@Output() onEnrollment = new EventEmitter<void>();
160172

161173
verificationCodeLabel = injectTranslation("labels", "verificationCode");
@@ -224,10 +236,16 @@ export class TotpMultiFactorVerificationFormComponent {
224236
</div>
225237
`,
226238
})
239+
/**
240+
* A form component for TOTP multi-factor authentication enrollment.
241+
*
242+
* Manages the flow between secret generation and verification for TOTP MFA enrollment.
243+
*/
227244
export class TotpMultiFactorEnrollmentFormComponent {
228245
private ui = injectUI();
229246

230247
enrollment = signal<{ secret: TotpSecret; displayName: string } | null>(null);
248+
/** Event emitter fired when MFA enrollment is completed. */
231249
@Output() onEnrollment = new EventEmitter<void>();
232250

233251
constructor() {

packages/angular/src/lib/auth/forms/multi-factor-auth-assertion-form.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ import { ButtonComponent } from "../../components/button";
5959
</div>
6060
`,
6161
})
62+
/**
63+
* A form component for multi-factor authentication assertion.
64+
*
65+
* Allows users to select and complete MFA verification using SMS or TOTP.
66+
*/
6267
export class MultiFactorAuthAssertionFormComponent {
6368
private ui = injectUI();
6469

@@ -71,6 +76,7 @@ export class MultiFactorAuthAssertionFormComponent {
7176
});
7277
}
7378

79+
/** Event emitter for successful MFA assertion. */
7480
@Output() onSuccess = new EventEmitter<UserCredential>();
7581

7682
resolver = computed(() => {

packages/angular/src/lib/auth/forms/multi-factor-auth-enrollment-form.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,15 @@ type Hint = (typeof FactorId)[keyof typeof FactorId];
6060
</div>
6161
`,
6262
})
63+
/**
64+
* A form component for multi-factor authentication enrollment.
65+
*
66+
* Allows users to enroll in MFA using SMS or TOTP methods.
67+
*/
6368
export class MultiFactorAuthEnrollmentFormComponent implements OnInit {
69+
/** The available MFA factor types for enrollment. */
6470
hints = input<Hint[]>([FactorId.TOTP, FactorId.PHONE]);
71+
/** Event emitter fired when MFA enrollment is completed. */
6572
@Output() onEnrollment = new EventEmitter<void>();
6673

6774
selectedHint = signal<Hint | undefined>(undefined);

0 commit comments

Comments
 (0)