@aooth/auth-moost 0.2.1 → 0.2.2

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.
@@ -1,10 +1,9 @@
1
1
  import { TAtscriptAnnotatedType, TAtscriptTypeObject, TMetadataMap, TValidatorOptions, Validator } from "@atscript/typescript/utils";
2
- //#region src/atscript/models/forms.as.d.ts
3
2
  /**
4
3
  * Atscript interface **WithInlineConsentForm**
5
4
  * @see {@link ./forms.as:34:18}
6
5
  */
7
- declare class WithInlineConsentForm {
6
+ export declare class WithInlineConsentForm {
8
7
  consents: string[];
9
8
  static __is_atscript_annotated_type: true;
10
9
  static type: TAtscriptTypeObject<keyof WithInlineConsentForm, WithInlineConsentForm>;
@@ -19,7 +18,7 @@ declare class WithInlineConsentForm {
19
18
  * Atscript interface **LoginCredentialsForm**
20
19
  * @see {@link ./forms.as:61:18}
21
20
  */
22
- declare class LoginCredentialsForm {
21
+ export declare class LoginCredentialsForm {
23
22
  username: string;
24
23
  password: string;
25
24
  // signup: ui.action
@@ -38,7 +37,7 @@ declare class LoginCredentialsForm {
38
37
  * Atscript interface **MfaCodeForm**
39
38
  * @see {@link ./forms.as:137:18}
40
39
  */
41
- declare class MfaCodeForm {
40
+ export declare class MfaCodeForm {
42
41
  // transportHint: ui.paragraph
43
42
  code: string;
44
43
  // useDifferentMethod: ui.action
@@ -56,7 +55,7 @@ declare class MfaCodeForm {
56
55
  * Atscript interface **EmailIdentifierForm**
57
56
  * @see {@link ./forms.as:174:18}
58
57
  */
59
- declare class EmailIdentifierForm {
58
+ export declare class EmailIdentifierForm {
60
59
  email: string; /* email */
61
60
  // backToLogin: ui.action
62
61
  static __is_atscript_annotated_type: true;
@@ -72,7 +71,7 @@ declare class EmailIdentifierForm {
72
71
  * Atscript interface **SignupForm**
73
72
  * @see {@link ./forms.as:206:18}
74
73
  */
75
- declare class SignupForm {
74
+ export declare class SignupForm {
76
75
  email: string; /* email */
77
76
  // backToLogin: ui.action
78
77
  static __is_atscript_annotated_type: true;
@@ -88,7 +87,7 @@ declare class SignupForm {
88
87
  * Atscript interface **SetPasswordForm**
89
88
  * @see {@link ./forms.as:264:18}
90
89
  */
91
- declare class SetPasswordForm extends WithInlineConsentForm {
90
+ export declare class SetPasswordForm extends WithInlineConsentForm {
92
91
  // intro: ui.paragraph
93
92
  newPassword: string;
94
93
  confirmPassword: string;
@@ -106,7 +105,7 @@ declare class SetPasswordForm extends WithInlineConsentForm {
106
105
  * Atscript interface **InviteForm**
107
106
  * @see {@link ./forms.as:342:18}
108
107
  */
109
- declare class InviteForm {
108
+ export declare class InviteForm {
110
109
  email: string; /* email */
111
110
  roles: string[];
112
111
  static __is_atscript_annotated_type: true;
@@ -122,7 +121,7 @@ declare class InviteForm {
122
121
  * Atscript interface **InviteChooseUsernameForm**
123
122
  * @see {@link ./forms.as:367:18}
124
123
  */
125
- declare class InviteChooseUsernameForm {
124
+ export declare class InviteChooseUsernameForm {
126
125
  username: string;
127
126
  static __is_atscript_annotated_type: true;
128
127
  static type: TAtscriptTypeObject<keyof InviteChooseUsernameForm, InviteChooseUsernameForm>;
@@ -137,7 +136,7 @@ declare class InviteChooseUsernameForm {
137
136
  * Atscript interface **Select2faForm**
138
137
  * @see {@link ./forms.as:391:18}
139
138
  */
140
- declare class Select2faForm {
139
+ export declare class Select2faForm {
141
140
  methodName: string;
142
141
  saveAsDefault: boolean;
143
142
  rememberDevice: boolean;
@@ -154,7 +153,7 @@ declare class Select2faForm {
154
153
  * Atscript interface **PincodeForm**
155
154
  * @see {@link ./forms.as:441:18}
156
155
  */
157
- declare class PincodeForm {
156
+ export declare class PincodeForm {
158
157
  // transportHint: ui.paragraph
159
158
  code: string;
160
159
  rememberDevice: boolean;
@@ -174,7 +173,7 @@ declare class PincodeForm {
174
173
  * Atscript interface **AskEmailForm**
175
174
  * @see {@link ./forms.as:480:18}
176
175
  */
177
- declare class AskEmailForm extends WithInlineConsentForm {
176
+ export declare class AskEmailForm extends WithInlineConsentForm {
178
177
  // disclosure: ui.paragraph
179
178
  email: string; /* email */
180
179
  static __is_atscript_annotated_type: true;
@@ -190,7 +189,7 @@ declare class AskEmailForm extends WithInlineConsentForm {
190
189
  * Atscript interface **AskPhoneForm**
191
190
  * @see {@link ./forms.as:510:18}
192
191
  */
193
- declare class AskPhoneForm extends WithInlineConsentForm {
192
+ export declare class AskPhoneForm extends WithInlineConsentForm {
194
193
  // disclosure: ui.paragraph
195
194
  phone: string;
196
195
  static __is_atscript_annotated_type: true;
@@ -206,7 +205,7 @@ declare class AskPhoneForm extends WithInlineConsentForm {
206
205
  * Atscript interface **EnrollPickMethodForm**
207
206
  * @see {@link ./forms.as:534:18}
208
207
  */
209
- declare class EnrollPickMethodForm {
208
+ export declare class EnrollPickMethodForm {
210
209
  method: string;
211
210
  // skip: ui.action
212
211
  // cancel: ui.action
@@ -223,7 +222,7 @@ declare class EnrollPickMethodForm {
223
222
  * Atscript interface **EnrollAddressForm**
224
223
  * @see {@link ./forms.as:568:18}
225
224
  */
226
- declare class EnrollAddressForm {
225
+ export declare class EnrollAddressForm {
227
226
  address: string;
228
227
  // skip: ui.action
229
228
  // cancel: ui.action
@@ -241,7 +240,7 @@ declare class EnrollAddressForm {
241
240
  * Atscript interface **EnrollConfirmForm**
242
241
  * @see {@link ./forms.as:614:18}
243
242
  */
244
- declare class EnrollConfirmForm {
243
+ export declare class EnrollConfirmForm {
245
244
  // transportHint: ui.paragraph
246
245
  code: string;
247
246
  // resend: ui.action
@@ -261,7 +260,7 @@ declare class EnrollConfirmForm {
261
260
  * Atscript interface **EnrollTotpQrForm**
262
261
  * @see {@link ./forms.as:664:18}
263
262
  */
264
- declare class EnrollTotpQrForm {
263
+ export declare class EnrollTotpQrForm {
265
264
  // qrCode: ui.paragraph
266
265
  // useDifferentMethod: ui.action
267
266
  // cancel: ui.action
@@ -279,7 +278,7 @@ declare class EnrollTotpQrForm {
279
278
  * Atscript interface **ManageMfaForm**
280
279
  * @see {@link ./forms.as:707:18}
281
280
  */
282
- declare class ManageMfaForm {
281
+ export declare class ManageMfaForm {
283
282
  // lockedNote: ui.paragraph
284
283
  // requiredNote: ui.paragraph
285
284
  operation: string;
@@ -297,7 +296,7 @@ declare class ManageMfaForm {
297
296
  * Atscript interface **RemoveMfaConfirmForm**
298
297
  * @see {@link ./forms.as:741:18}
299
298
  */
300
- declare class RemoveMfaConfirmForm {
299
+ export declare class RemoveMfaConfirmForm {
301
300
  // notice: ui.paragraph
302
301
  // cancel: ui.action
303
302
  static __is_atscript_annotated_type: true;
@@ -313,7 +312,7 @@ declare class RemoveMfaConfirmForm {
313
312
  * Atscript interface **PasswordReauthForm**
314
313
  * @see {@link ./forms.as:764:18}
315
314
  */
316
- declare class PasswordReauthForm {
315
+ export declare class PasswordReauthForm {
317
316
  password: string;
318
317
  // cancel: ui.action
319
318
  static __is_atscript_annotated_type: true;
@@ -329,7 +328,7 @@ declare class PasswordReauthForm {
329
328
  * Atscript interface **StepUpConfirmForm**
330
329
  * @see {@link ./forms.as:795:18}
331
330
  */
332
- declare class StepUpConfirmForm {
331
+ export declare class StepUpConfirmForm {
333
332
  // notice: ui.paragraph
334
333
  // useDifferentMethod: ui.action
335
334
  // cancel: ui.action
@@ -346,7 +345,7 @@ declare class StepUpConfirmForm {
346
345
  * Atscript interface **TermsBumpForm**
347
346
  * @see {@link ./forms.as:823:18}
348
347
  */
349
- declare class TermsBumpForm extends WithInlineConsentForm {
348
+ export declare class TermsBumpForm extends WithInlineConsentForm {
350
349
  static __is_atscript_annotated_type: true;
351
350
  static type: TAtscriptTypeObject<keyof TermsBumpForm, TermsBumpForm>;
352
351
  static metadata: TMetadataMap<AtscriptMetadata>;
@@ -360,7 +359,7 @@ declare class TermsBumpForm extends WithInlineConsentForm {
360
359
  * Atscript interface **ConcurrencyLimitForm**
361
360
  * @see {@link ./forms.as:836:18}
362
361
  */
363
- declare class ConcurrencyLimitForm {
362
+ export declare class ConcurrencyLimitForm {
364
363
  static __is_atscript_annotated_type: true;
365
364
  static type: TAtscriptTypeObject<keyof ConcurrencyLimitForm, ConcurrencyLimitForm>;
366
365
  static metadata: TMetadataMap<AtscriptMetadata>;
@@ -374,7 +373,7 @@ declare class ConcurrencyLimitForm {
374
373
  * Atscript interface **MagicLinkRequestForm**
375
374
  * @see {@link ./forms.as:846:18}
376
375
  */
377
- declare class MagicLinkRequestForm {
376
+ export declare class MagicLinkRequestForm {
378
377
  identifier: string;
379
378
  static __is_atscript_annotated_type: true;
380
379
  static type: TAtscriptTypeObject<keyof MagicLinkRequestForm, MagicLinkRequestForm>;
@@ -389,7 +388,7 @@ declare class MagicLinkRequestForm {
389
388
  * Atscript interface **RecoveryModeSelectForm**
390
389
  * @see {@link ./forms.as:861:18}
391
390
  */
392
- declare class RecoveryModeSelectForm {
391
+ export declare class RecoveryModeSelectForm {
393
392
  mode: string;
394
393
  static __is_atscript_annotated_type: true;
395
394
  static type: TAtscriptTypeObject<keyof RecoveryModeSelectForm, RecoveryModeSelectForm>;
@@ -404,7 +403,7 @@ declare class RecoveryModeSelectForm {
404
403
  * Atscript interface **RecoveryFactorForm**
405
404
  * @see {@link ./forms.as:884:18}
406
405
  */
407
- declare class RecoveryFactorForm {
406
+ export declare class RecoveryFactorForm {
408
407
  factor: string;
409
408
  value: string;
410
409
  static __is_atscript_annotated_type: true;
@@ -420,7 +419,7 @@ declare class RecoveryFactorForm {
420
419
  * Atscript interface **ChangePasswordForm**
421
420
  * @see {@link ./forms.as:918:18}
422
421
  */
423
- declare class ChangePasswordForm {
422
+ export declare class ChangePasswordForm {
424
423
  // intro: ui.paragraph
425
424
  currentPassword: string;
426
425
  newPassword: string;
@@ -439,7 +438,7 @@ declare class ChangePasswordForm {
439
438
  * Atscript interface **ProveControlForm**
440
439
  * @see {@link ./forms.as:983:18}
441
440
  */
442
- declare class ProveControlForm {
441
+ export declare class ProveControlForm {
443
442
  // intro: ui.paragraph
444
443
  password: string;
445
444
  // cancel: ui.action
@@ -456,7 +455,7 @@ declare class ProveControlForm {
456
455
  * Atscript interface **ProveControlOtpForm**
457
456
  * @see {@link ./forms.as:1018:18}
458
457
  */
459
- declare class ProveControlOtpForm {
458
+ export declare class ProveControlOtpForm {
460
459
  // intro: ui.paragraph
461
460
  code: string;
462
461
  // resend: ui.action
@@ -474,7 +473,7 @@ declare class ProveControlOtpForm {
474
473
  * Atscript interface **AuthorizeConsentForm**
475
474
  * @see {@link ./forms.as:1070:18}
476
475
  */
477
- declare class AuthorizeConsentForm {
476
+ export declare class AuthorizeConsentForm {
478
477
  // notice: ui.paragraph
479
478
  // signedIn: ui.paragraph
480
479
  // deny: ui.action
@@ -487,6 +486,4 @@ declare class AuthorizeConsentForm {
487
486
  /** @deprecated Example Data support is disabled. To enable, set `exampleData: true` in tsPlugin options. */
488
487
  static toExampleData?: () => any;
489
488
  }
490
- // prettier-ignore-end
491
- //#endregion
492
- export { AskEmailForm, AskPhoneForm, AuthorizeConsentForm, ChangePasswordForm, ConcurrencyLimitForm, EmailIdentifierForm, EnrollAddressForm, EnrollConfirmForm, EnrollPickMethodForm, EnrollTotpQrForm, InviteChooseUsernameForm, InviteForm, LoginCredentialsForm, MagicLinkRequestForm, ManageMfaForm, MfaCodeForm, PasswordReauthForm, PincodeForm, ProveControlForm, ProveControlOtpForm, RecoveryFactorForm, RecoveryModeSelectForm, RemoveMfaConfirmForm, Select2faForm, SetPasswordForm, SignupForm, StepUpConfirmForm, TermsBumpForm, WithInlineConsentForm };
489
+ // prettier-ignore-end
@@ -1,2 +1 @@
1
- import { C as RemoveMfaConfirmForm, D as StepUpConfirmForm, E as SignupForm, O as TermsBumpForm, S as RecoveryModeSelectForm, T as SetPasswordForm, _ as PasswordReauthForm, a as ConcurrencyLimitForm, b as ProveControlOtpForm, c as EnrollConfirmForm, d as InviteChooseUsernameForm, f as InviteForm, g as MfaCodeForm, h as ManageMfaForm, i as ChangePasswordForm, k as WithInlineConsentForm, l as EnrollPickMethodForm, m as MagicLinkRequestForm, n as AskPhoneForm, o as EmailIdentifierForm, p as LoginCredentialsForm, r as AuthorizeConsentForm, s as EnrollAddressForm, t as AskEmailForm, u as EnrollTotpQrForm, v as PincodeForm, w as Select2faForm, x as RecoveryFactorForm, y as ProveControlForm } from "../forms-DDn6m5rP.mjs";
2
- export { AskEmailForm, AskPhoneForm, AuthorizeConsentForm, ChangePasswordForm, ConcurrencyLimitForm, EmailIdentifierForm, EnrollAddressForm, EnrollConfirmForm, EnrollPickMethodForm, EnrollTotpQrForm, InviteChooseUsernameForm, InviteForm, LoginCredentialsForm, MagicLinkRequestForm, ManageMfaForm, MfaCodeForm, PasswordReauthForm, PincodeForm, ProveControlForm, ProveControlOtpForm, RecoveryFactorForm, RecoveryModeSelectForm, RemoveMfaConfirmForm, Select2faForm, SetPasswordForm, SignupForm, StepUpConfirmForm, TermsBumpForm, WithInlineConsentForm };
1
+ export { t as AskEmailForm, n as AskPhoneForm, r as AuthorizeConsentForm, i as ChangePasswordForm, a as ConcurrencyLimitForm, o as EmailIdentifierForm, s as EnrollAddressForm, c as EnrollConfirmForm, l as EnrollPickMethodForm, u as EnrollTotpQrForm, d as InviteChooseUsernameForm, f as InviteForm, p as LoginCredentialsForm, m as MagicLinkRequestForm, h as ManageMfaForm, g as MfaCodeForm, _ as PasswordReauthForm, v as PincodeForm, y as ProveControlForm, b as ProveControlOtpForm, x as RecoveryFactorForm, S as RecoveryModeSelectForm, C as RemoveMfaConfirmForm, w as Select2faForm, T as SetPasswordForm, E as SignupForm, D as StepUpConfirmForm, O as TermsBumpForm, k as WithInlineConsentForm } from "../forms-C_VNxSDn.mjs";
@@ -1,5 +1,5 @@
1
1
  import { $ak, $f, $nr, defineAnnotatedType, throwFeatureDisabled } from "@atscript/typescript/utils";
2
- //#region src/atscript/models/forms.as
2
+ // src/atscript/models/forms.as
3
3
  var WithInlineConsentForm = class {
4
4
  static __is_atscript_annotated_type = true;
5
5
  static type = {};
@@ -470,5 +470,4 @@ defineAnnotatedType("object", AuthorizeConsentForm).annotate("meta.label", "Auth
470
470
  name: "align",
471
471
  value: "center"
472
472
  }, true).annotate("ui.form.pushDown", true).optional().$type);
473
- //#endregion
474
473
  export { RemoveMfaConfirmForm as C, StepUpConfirmForm as D, SignupForm as E, TermsBumpForm as O, RecoveryModeSelectForm as S, SetPasswordForm as T, PasswordReauthForm as _, ConcurrencyLimitForm as a, ProveControlOtpForm as b, EnrollConfirmForm as c, InviteChooseUsernameForm as d, InviteForm as f, MfaCodeForm as g, ManageMfaForm as h, ChangePasswordForm as i, WithInlineConsentForm as k, EnrollPickMethodForm as l, MagicLinkRequestForm as m, AskPhoneForm as n, EmailIdentifierForm as o, LoginCredentialsForm as p, AuthorizeConsentForm as r, EnrollAddressForm as s, AskEmailForm as t, EnrollTotpQrForm as u, PincodeForm as v, Select2faForm as w, RecoveryFactorForm as x, ProveControlForm as y };
package/dist/index.d.mts CHANGED
@@ -9,7 +9,6 @@ import { MoostWf, WfOutlet, WfOutletTokenConfig, WfStateStrategy } from "@moostj
9
9
  import { FederatedLoginService, NormalizedProfile, OAuthProviderRegistry } from "@aooth/idp";
10
10
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
11
11
  import { AuthCodeStore, AuthorizationServerMetadata, AuthorizationServerMetadata as AuthorizationServerMetadata$1, BuildAuthorizationServerMetadataOptions, BuildProtectedResourceMetadataOptions, ClientRedirectPolicy, DynamicClientRegistration, DynamicClientRegistration as DynamicClientRegistration$1, DynamicClientRegistrationOptions, IdTokenSigner, OidcClaimsResolver, PendingAuthorizationStore, ProtectedResourceMetadata, WwwAuthenticateBearerChallengeOptions, buildAuthorizationServerMetadata, buildProtectedResourceMetadata, buildWwwAuthenticateBearerChallenge, canonicalizeIssuer } from "@aooth/auth/authz";
12
- //#region src/auth.config.d.ts
13
12
  /** Resolved cookie attributes. Same shape is used for both access + refresh. */
14
13
  interface ResolvedAuthCookieConfig {
15
14
  name: string;
@@ -67,8 +66,6 @@ interface ResolvedAuthOptions {
67
66
  enableBearer: boolean;
68
67
  exposeTokensInBody: boolean;
69
68
  }
70
- //#endregion
71
- //#region src/consent.store.d.ts
72
69
  /**
73
70
  * Consent event emitted to the `ConsentStore.save(username, events)` DI
74
71
  * provider. Storage shape is intentionally the consumer's call — Mongo users
@@ -133,7 +130,7 @@ interface ConsentDescriptor {
133
130
  * no-op defaults — customers extend this class and replace via
134
131
  * `createReplaceRegistry([ConsentStore, MyConsentStore])`.
135
132
  */
136
- declare class ConsentStore {
133
+ export declare class ConsentStore {
137
134
  /**
138
135
  * Returns descriptors for general-purpose consents this user still needs to
139
136
  * accept on the next prompt boundary — terms / privacy / marketing / age /
@@ -170,8 +167,6 @@ declare class ConsentStore {
170
167
  */
171
168
  recordOtpChannelConsent(_username: string, _channel: "email" | "sms", _target: string, _disclosure: string): Promise<void>;
172
169
  }
173
- //#endregion
174
- //#region src/auth.guard.d.ts
175
170
  /**
176
171
  * `GUARD`-priority interceptor factory that authenticates incoming requests.
177
172
  *
@@ -193,15 +188,13 @@ declare class ConsentStore {
193
188
  * an admin-only invite endpoint protects its outlet HTTP route, not the
194
189
  * step handler).
195
190
  */
196
- declare function authGuardInterceptor(opts?: AuthOptions): TInterceptorDef;
191
+ export declare function authGuardInterceptor(opts?: AuthOptions): TInterceptorDef;
197
192
  /**
198
193
  * Decorator-factory sugar for attaching `authGuardInterceptor(opts)` to a
199
194
  * specific controller or method instead of globally. Equivalent to
200
195
  * `@Intercept(authGuardInterceptor(opts))`.
201
196
  */
202
- declare function AuthGuarded(opts?: AuthOptions): ClassDecorator & MethodDecorator;
203
- //#endregion
204
- //#region ../../node_modules/.pnpm/@wooksjs+event-wf@0.8.0_@prostojs+logger@0.4.3_@prostojs+router@0.3.6_@wooksjs+event-co_86044e452e9fcfb26549e7ecde073940/node_modules/@wooksjs/event-wf/dist/index.d.ts
197
+ export declare function AuthGuarded(opts?: AuthOptions): ClassDecorator & MethodDecorator;
205
198
  interface WfFinishedResponse {
206
199
  type: 'redirect' | 'data';
207
200
  /** Redirect URL or response body */
@@ -214,8 +207,6 @@ interface WfFinishedResponse {
214
207
  options?: Record<string, unknown>;
215
208
  }>;
216
209
  }
217
- //#endregion
218
- //#region src/auth.dto.d.ts
219
210
  /** POST /auth/refresh request body. Falls back to the refresh cookie when absent. */
220
211
  interface AuthRefreshBody {
221
212
  refreshToken?: string;
@@ -249,8 +240,6 @@ interface AuthLoginResponse {
249
240
  interface AuthOkResponse {
250
241
  ok: true;
251
242
  }
252
- //#endregion
253
- //#region src/auth.composables.d.ts
254
243
  interface AuthBindings {
255
244
  getAuthContext<TPayload extends object = Record<string, unknown>>(): AuthContext$1<TPayload> | null;
256
245
  /** @throws `HttpError(401)` if no `AuthContext` is present in the event. */
@@ -306,9 +295,7 @@ interface AuthBindings {
306
295
  * `HttpError(500)` loudly — that's a configuration error, not a runtime
307
296
  * fallback case.
308
297
  */
309
- declare const useAuth: import("@wooksjs/event-core").WookComposable<AuthBindings>;
310
- //#endregion
311
- //#region src/auth.decorator.d.ts
298
+ export declare const useAuth: import("@wooksjs/event-core").WookComposable<AuthBindings>;
312
299
  /**
313
300
  * Marks a route or controller as fully public — opts out of BOTH
314
301
  * authentication (auth-moost's bearer guard) AND authorization
@@ -321,7 +308,7 @@ declare const useAuth: import("@wooksjs/event-core").WookComposable<AuthBindings
321
308
  *
322
309
  * Method-level decoration overrides class-level.
323
310
  */
324
- declare const Public: () => ClassDecorator & MethodDecorator;
311
+ export declare const Public: () => ClassDecorator & MethodDecorator;
325
312
  /**
326
313
  * Resolves the authenticated user's id (string) for a handler parameter.
327
314
  *
@@ -330,9 +317,7 @@ declare const Public: () => ClassDecorator & MethodDecorator;
330
317
  * `AuthContext` is credential context, not user profile data, and this library
331
318
  * does not own a user profile type.
332
319
  */
333
- declare const UserId: () => ParameterDecorator & PropertyDecorator;
334
- //#endregion
335
- //#region src/auth.mate.d.ts
320
+ export declare const UserId: () => ParameterDecorator & PropertyDecorator;
336
321
  /**
337
322
  * Auth metadata fields written by `@Public()` and read by `authGuardInterceptor`.
338
323
  * Merged into `TMoostMetadata` so other moost-aware tooling sees them.
@@ -348,9 +333,7 @@ type AuthMate = Mate<TMoostMetadata & {
348
333
  }, TMoostMetadata & {
349
334
  params: TMateParamMeta[];
350
335
  }>;
351
- declare function getAuthMate(): AuthMate;
352
- //#endregion
353
- //#region src/workflow/auth-messages.d.ts
336
+ export declare function getAuthMate(): AuthMate;
354
337
  /**
355
338
  * Code-keyed catalogue of every user-facing text `AuthWorkflow` produces —
356
339
  * form errors, banners, finish envelopes and button labels. Templates are
@@ -360,7 +343,7 @@ declare function getAuthMate(): AuthMate;
360
343
  * function that receives the code and params and returns the text — e.g. a
361
344
  * lookup in your own i18n library), or override `AuthWorkflow.msg()`.
362
345
  */
363
- declare const AOOTH_MESSAGES: {
346
+ export declare const AOOTH_MESSAGES: {
364
347
  readonly INVALID_CREDENTIALS: "Invalid credentials";
365
348
  readonly ACCOUNT_LOCKED: "Account locked, please try again later";
366
349
  readonly INVALID_PASSWORD: "Invalid password";
@@ -421,26 +404,24 @@ type AoothMessageParams = Readonly<Record<string, string | number>>;
421
404
  */
422
405
  type AoothMessages = Partial<Record<AoothMessageCode, string>> | ((code: AoothMessageCode, params: AoothMessageParams) => string | undefined);
423
406
  /** Fill `{name}` placeholders from `params`; unknown placeholders are kept. */
424
- declare function renderAoothMessage(template: string, params?: AoothMessageParams): string;
407
+ export declare function renderAoothMessage(template: string, params?: AoothMessageParams): string;
425
408
  /** Resolve `code` through `messages` (when given), falling back to the English template. */
426
- declare function resolveAoothMessage(code: AoothMessageCode, params?: AoothMessageParams, messages?: AoothMessages): string;
427
- //#endregion
428
- //#region src/auth.controller.d.ts
409
+ export declare function resolveAoothMessage(code: AoothMessageCode, params?: AoothMessageParams, messages?: AoothMessages): string;
429
410
  /** Workflows allowed by the bundled `/auth/trigger` endpoint. Subclasses override `triggerWf()` to extend. */
430
- declare const DEFAULT_AUTH_WORKFLOWS: readonly ["auth/login/flow", "auth/invite/start", "auth/recovery/flow", "auth/signup/flow"];
411
+ export declare const DEFAULT_AUTH_WORKFLOWS: readonly ["auth/login/flow", "auth/invite/start", "auth/recovery/flow", "auth/signup/flow"];
431
412
  /**
432
413
  * Workflow id allowed by the GUARDED `/auth/change-password` trigger.
433
414
  * Deliberately NOT in `DEFAULT_AUTH_WORKFLOWS` — the authenticated
434
415
  * change-password flow must never be reachable from the public `/auth/trigger`.
435
416
  */
436
- declare const CHANGE_PASSWORD_WORKFLOW = "auth/change-password/flow";
417
+ export declare const CHANGE_PASSWORD_WORKFLOW = "auth/change-password/flow";
437
418
  /**
438
419
  * Workflow id allowed by the GUARDED `/auth/add-mfa` trigger — the authenticated
439
420
  * "add a second factor" flow. Like {@link CHANGE_PASSWORD_WORKFLOW}, deliberately
440
421
  * NOT in `DEFAULT_AUTH_WORKFLOWS`: it must never be reachable from the public
441
422
  * `/auth/trigger`.
442
423
  */
443
- declare const ADD_MFA_WORKFLOW = "auth/add-mfa/flow";
424
+ export declare const ADD_MFA_WORKFLOW = "auth/add-mfa/flow";
444
425
  /**
445
426
  * Public REST endpoints for credential management. Four endpoints total:
446
427
  *
@@ -458,7 +439,7 @@ declare const ADD_MFA_WORKFLOW = "auth/add-mfa/flow";
458
439
  * allow-list (override `triggerWf()` with a different `@WfTrigger({ allow })`)
459
440
  * or to inject custom outlets / state stores by subclassing `WfTriggerProvider`.
460
441
  */
461
- declare class AuthController {
442
+ export declare class AuthController {
462
443
  protected readonly auth: AuthCredential;
463
444
  protected readonly users?: UserService | undefined;
464
445
  constructor(auth: AuthCredential, users?: UserService | undefined);
@@ -540,8 +521,6 @@ declare class AuthController {
540
521
  messages?: AoothMessages;
541
522
  };
542
523
  }
543
- //#endregion
544
- //#region src/sessions.controller.d.ts
545
524
  /**
546
525
  * Injectable read-time session enricher. Default is identity — aooth ships NO
547
526
  * UA-parser or GeoIP dependency. Consumers who want `device` / `browser` / `os`
@@ -561,7 +540,7 @@ declare class AuthController {
561
540
  *
562
541
  * Singleton scope is required — `@Injectable()` (no scope arg) → SINGLETON.
563
542
  */
564
- declare class SessionEnricherProvider {
543
+ export declare class SessionEnricherProvider {
565
544
  enrich(session: SessionInfo$1): EnrichedSession$1 | Promise<EnrichedSession$1>;
566
545
  }
567
546
  /**
@@ -587,7 +566,7 @@ declare class SessionEnricherProvider {
587
566
  * NOT `@Public()` — the auth guard rejects unauthenticated callers with 401 and
588
567
  * ARBAC gates each action; a customer enables it with `allow("auth.sessions", "*")`.
589
568
  */
590
- declare class SessionsController {
569
+ export declare class SessionsController {
591
570
  protected readonly auth: AuthCredential;
592
571
  protected readonly enricher: SessionEnricherProvider;
593
572
  constructor(auth: AuthCredential, enricher: SessionEnricherProvider);
@@ -611,8 +590,6 @@ declare class SessionsController {
611
590
  revoked: number;
612
591
  }>;
613
592
  }
614
- //#endregion
615
- //#region src/wf-trigger/decorator.d.ts
616
593
  interface WfTriggerOpts {
617
594
  /**
618
595
  * Workflow ids this trigger may START and RESUME (a leading `/` is ignored).
@@ -635,9 +612,7 @@ interface WfTriggerOpts {
635
612
  * documented escape hatch: interceptors are functions, not classes, so there's
636
613
  * no ctor to inject into. Every class still uses constructor injection.
637
614
  */
638
- declare const WfTrigger: (opts?: WfTriggerOpts) => ClassDecorator & MethodDecorator;
639
- //#endregion
640
- //#region src/wf-trigger/provider.d.ts
615
+ export declare const WfTrigger: (opts?: WfTriggerOpts) => ClassDecorator & MethodDecorator;
641
616
  /**
642
617
  * DI singleton owning the workflow-trigger wiring: state persistence, outlets,
643
618
  * and token wire. Consumers subclass to swap the durable state strategy, add
@@ -697,8 +672,8 @@ type StateRegistry = {
697
672
  * Deterministic — the same input always yields the same key, so it is stable
698
673
  * across restarts (matching what `deriveStateKey` provided).
699
674
  */
700
- declare function deriveWfStateSecret(secret: string): Buffer;
701
- declare class WfTriggerProvider {
675
+ export declare function deriveWfStateSecret(secret: string): Buffer;
676
+ export declare class WfTriggerProvider {
702
677
  protected readonly wf: MoostWf;
703
678
  protected readonly auth: AuthCredential;
704
679
  /**
@@ -738,19 +713,15 @@ declare class WfTriggerProvider {
738
713
  token?: WfOutletTokenConfig;
739
714
  }): Promise<unknown>;
740
715
  }
741
- //#endregion
742
- //#region src/workflow/invite-outlet.d.ts
743
716
  /** Name of the outlet `AuthWorkflow` pauses on for `inviteDelivery: 'deliver' | 'return-link'`. */
744
- declare const INVITE_OUTLET = "invite";
717
+ export declare const INVITE_OUTLET = "invite";
745
718
  /**
746
719
  * The `invite` outlet (registered by default on `WfTriggerProvider`): hands
747
720
  * the resume token to the callback the `send-email` step registered, which
748
721
  * builds the link and delivers it (`'deliver'`) or returns it to the issuer
749
722
  * (`'return-link'`). The token never rides the response on its own.
750
723
  */
751
- declare function createInviteOutlet(): WfOutlet;
752
- //#endregion
753
- //#region src/rate-limit/mate.d.ts
724
+ export declare function createInviteOutlet(): WfOutlet;
754
725
  /**
755
726
  * Caller-identity strategy for a rate-limited route (RL.spec.md §5.3):
756
727
  * - `'ip'` — client IP (the public-endpoint mode; honors `trustProxy`).
@@ -810,9 +781,7 @@ type RateLimitMate = Mate<TMoostMetadata & {
810
781
  }, TMoostMetadata & {
811
782
  params: TMateParamMeta[];
812
783
  }>;
813
- declare function getRateLimitMate(): RateLimitMate;
814
- //#endregion
815
- //#region src/rate-limit/interceptor.d.ts
784
+ export declare function getRateLimitMate(): RateLimitMate;
816
785
  interface RateLimitInterceptorOptions {
817
786
  /**
818
787
  * The shared limiter (wire your `RateLimitStoreRedis` here). When omitted,
@@ -872,9 +841,7 @@ interface RateLimitInterceptorOptions {
872
841
  * the accumulated response (they survive the throw — wooks renders the error
873
842
  * onto the same `HttpResponse`), then `HttpError(429, message)` is thrown.
874
843
  */
875
- declare function rateLimitInterceptors(opts?: RateLimitInterceptorOptions): TInterceptorDef[];
876
- //#endregion
877
- //#region src/rate-limit/decorator.d.ts
844
+ export declare function rateLimitInterceptors(opts?: RateLimitInterceptorOptions): TInterceptorDef[];
878
845
  /**
879
846
  * Declares rate-limit rules for a controller method (or every method of a
880
847
  * controller, when applied at class level — method-level metadata replaces
@@ -896,8 +863,8 @@ declare function rateLimitInterceptors(opts?: RateLimitInterceptorOptions): TInt
896
863
  * Rules are parsed eagerly, so a bad rule string throws at decoration
897
864
  * (boot) time, not per request.
898
865
  */
899
- declare function RateLimit(disabled: false): ClassDecorator & MethodDecorator;
900
- declare function RateLimit(...rulesAndOpts: [RateLimitRuleInput$1, ...Array<RateLimitRuleInput$1 | RateLimitDecoratorOptions>]): ClassDecorator & MethodDecorator;
866
+ export declare function RateLimit(disabled: false): ClassDecorator & MethodDecorator;
867
+ export declare function RateLimit(...rulesAndOpts: [RateLimitRuleInput$1, ...Array<RateLimitRuleInput$1 | RateLimitDecoratorOptions>]): ClassDecorator & MethodDecorator;
901
868
  /**
902
869
  * Decorator-factory sugar for attaching the `rateLimitInterceptors(opts)`
903
870
  * PAIR to a specific controller or method instead of globally — the
@@ -905,9 +872,7 @@ declare function RateLimit(...rulesAndOpts: [RateLimitRuleInput$1, ...Array<Rate
905
872
  * dropping the pre-guard def loses flood protection for ip-keyed routes,
906
873
  * dropping the post-guard def silently disables `key: 'user'` routes.
907
874
  */
908
- declare function RateLimited(opts?: RateLimitInterceptorOptions): ClassDecorator & MethodDecorator;
909
- //#endregion
910
- //#region src/rate-limit/composables.d.ts
875
+ export declare function RateLimited(opts?: RateLimitInterceptorOptions): ClassDecorator & MethodDecorator;
911
876
  /**
912
877
  * Supply the rate-limit subject for a named key strategy — the seam for
913
878
  * custom IAMs / tenant resolvers. Call from GUARD-priority (or earlier)
@@ -915,9 +880,9 @@ declare function RateLimited(opts?: RateLimitInterceptorOptions): ClassDecorator
915
880
  * prefix, e.g. `iam:<sub>`) and always wins over the built-in `user` /
916
881
  * `session` derivations. Full contract: docs `/moost/rate-limit`.
917
882
  */
918
- declare function setRateLimitSubject(kind: string, subject: string, ctx?: EventContext): void;
883
+ export declare function setRateLimitSubject(kind: string, subject: string, ctx?: EventContext): void;
919
884
  /** Read a named rate-limit subject set for this event (or `undefined`). */
920
- declare function getRateLimitSubject(kind: string, ctx?: EventContext): string | undefined;
885
+ export declare function getRateLimitSubject(kind: string, ctx?: EventContext): string | undefined;
921
886
  interface RateLimitBindings {
922
887
  /**
923
888
  * The decision the interceptor computed for this event, or `null` when the
@@ -930,9 +895,7 @@ interface RateLimitBindings {
930
895
  * wook) — it's a single slot read, and workflow child events inherit the
931
896
  * HTTP parent's slot transparently.
932
897
  */
933
- declare function useRateLimit(ctx?: EventContext): RateLimitBindings;
934
- //#endregion
935
- //#region src/oauth/oauth.controller.d.ts
898
+ export declare function useRateLimit(ctx?: EventContext): RateLimitBindings;
936
899
  /**
937
900
  * REST surface for federated-login ACCOUNT MANAGEMENT (OAuth2 / OIDC), RFC
938
901
  * IDP.md §3.7. Two routes — anonymous LOGIN is NOT here: it lives in the login
@@ -966,7 +929,7 @@ declare function useRateLimit(ctx?: EventContext): RateLimitBindings;
966
929
  * session, never from a parameter. Subclass + add `@ArbacAction(...)` to gate
967
930
  * them further (e.g. an admin cross-user view).
968
931
  */
969
- declare class OAuthController {
932
+ export declare class OAuthController {
970
933
  protected readonly registry: OAuthProviderRegistry;
971
934
  protected readonly auth: AuthCredential;
972
935
  protected readonly users: UserService;
@@ -1053,29 +1016,25 @@ interface ConnectedAccount {
1053
1016
  displayName?: string;
1054
1017
  avatarUrl?: string;
1055
1018
  }
1056
- //#endregion
1057
- //#region src/oauth/oauth-csrf.d.ts
1058
1019
  /**
1059
1020
  * Name of the double-submit anti-CSRF cookie set at `/:provider/start` and
1060
1021
  * verified in `oauth-exchange`. Holds the signed-state `random`; the callback
1061
1022
  * proves it speaks for the same browser that started the flow by matching the
1062
1023
  * cookie value against the verified `state.random` (RFC IDP.md §7).
1063
1024
  */
1064
- declare const OAUTH_CSRF_COOKIE = "aooth_oauth";
1025
+ export declare const OAUTH_CSRF_COOKIE = "aooth_oauth";
1065
1026
  /**
1066
1027
  * Cookie attributes for the CSRF cookie. `SameSite=Lax` (NOT `Strict`) so the
1067
1028
  * top-level GET navigation BACK from the provider still carries it; `httpOnly`
1068
1029
  * so script can't read it; short `maxAge` matched to the state TTL. `secure` is
1069
1030
  * caller-controlled (off for the http test harness, on in production).
1070
1031
  */
1071
- declare function oauthCsrfCookieAttrs(opts: {
1032
+ export declare function oauthCsrfCookieAttrs(opts: {
1072
1033
  secure: boolean;
1073
1034
  /** Cookie lifetime in seconds — match the signed-state TTL (default 600). */
1074
1035
  maxAgeSec?: number;
1075
1036
  path?: string;
1076
1037
  }): TCookieAttributesInput;
1077
- //#endregion
1078
- //#region src/oauth/oauth-redirect.d.ts
1079
1038
  /**
1080
1039
  * Open-redirect defense for the post-login `redirect` carried across the OAuth
1081
1040
  * bounce (RFC IDP.md §7). The provider round-trips whatever target the SPA
@@ -1090,16 +1049,14 @@ declare function oauthCsrfCookieAttrs(opts: {
1090
1049
  * carry no control/whitespace characters (which browsers may strip, changing
1091
1050
  * the parsed target). Everything else falls back to the caller's default.
1092
1051
  */
1093
- declare function isSafeRelativeRedirect(target: string | undefined): target is string;
1052
+ export declare function isSafeRelativeRedirect(target: string | undefined): target is string;
1094
1053
  /**
1095
1054
  * Return `requested` when it is a safe same-origin relative redirect, else
1096
1055
  * `fallback`. Used at `/start` (before signing) and re-checked in
1097
1056
  * `oauth-exchange` (before honoring) — defense in depth around the signed
1098
1057
  * round-trip.
1099
1058
  */
1100
- declare function resolveOAuthRedirect(requested: string | undefined, fallback: string): string;
1101
- //#endregion
1102
- //#region src/oauth/oauth-runtime.d.ts
1059
+ export declare function resolveOAuthRedirect(requested: string | undefined, fallback: string): string;
1103
1060
  /**
1104
1061
  * DI holder bundling the two app-provided federated-login singletons the
1105
1062
  * `sso-callback` workflow step needs. It exists so the step can resolve them
@@ -1113,13 +1070,11 @@ declare function resolveOAuthRedirect(requested: string | undefined, fallback: s
1113
1070
  * unchanged). NO flow store: the PKCE verifier + OIDC nonce are derived
1114
1071
  * statelessly from the signed-state seed (see `OAuthProviderRegistry.deriveSeededPkce`).
1115
1072
  */
1116
- declare class OAuthRuntime {
1073
+ export declare class OAuthRuntime {
1117
1074
  readonly registry: OAuthProviderRegistry;
1118
1075
  readonly federated: FederatedLoginService;
1119
1076
  constructor(registry: OAuthProviderRegistry, federated: FederatedLoginService);
1120
1077
  }
1121
- //#endregion
1122
- //#region src/oauth/oauth-tokens.d.ts
1123
1078
  /**
1124
1079
  * Explicit string DI token for the ABSTRACT `FederatedIdentityStore`.
1125
1080
  *
@@ -1140,9 +1095,7 @@ declare class OAuthRuntime {
1140
1095
  * )
1141
1096
  * ```
1142
1097
  */
1143
- declare const FEDERATED_IDENTITY_STORE_TOKEN = "aooth:FederatedIdentityStore";
1144
- //#endregion
1145
- //#region src/authz/authorize.controller.d.ts
1098
+ export declare const FEDERATED_IDENTITY_STORE_TOKEN = "aooth:FederatedIdentityStore";
1146
1099
  /** RFC-6749-shaped token-endpoint error response. */
1147
1100
  interface TokenError {
1148
1101
  error: string;
@@ -1226,7 +1179,7 @@ interface ClientRegistrationFailure {
1226
1179
  * intent, audience, scope) is fixed at `/authorize` time and recorded on the
1227
1180
  * pending authorization + the issued code — never inferred at `/token`.
1228
1181
  */
1229
- declare class AuthorizeController {
1182
+ export declare class AuthorizeController {
1230
1183
  protected readonly auth: AuthCredential;
1231
1184
  protected readonly policy: ClientRedirectPolicy;
1232
1185
  protected readonly pending: PendingAuthorizationStore;
@@ -1341,8 +1294,6 @@ declare class AuthorizeController {
1341
1294
  /** Fail soft: 302 the validated client redirect with an `?error=` (+ echoed `state`). */
1342
1295
  protected redirectError(redirectUri: string, error: string, state: string | undefined): string;
1343
1296
  }
1344
- //#endregion
1345
- //#region src/authz/authorize-runtime.d.ts
1346
1297
  /**
1347
1298
  * DI holder bundling the two abstract authorization-server stores the login-wf
1348
1299
  * terminal (`mint-authz-code`) needs. A `@Step` body cannot `@Inject` a string
@@ -1352,13 +1303,11 @@ declare class AuthorizeController {
1352
1303
  * injects `AuthCredential` & friends), keeping `AuthWorkflow`'s documented ctor
1353
1304
  * untouched. Mirrors `OAuthRuntime`.
1354
1305
  */
1355
- declare class AuthorizeRuntime {
1306
+ export declare class AuthorizeRuntime {
1356
1307
  readonly pending: PendingAuthorizationStore;
1357
1308
  readonly codes: AuthCodeStore;
1358
1309
  constructor(pending: PendingAuthorizationStore, codes: AuthCodeStore);
1359
1310
  }
1360
- //#endregion
1361
- //#region src/authz/authz-binding.d.ts
1362
1311
  /**
1363
1312
  * Name of the double-submit cookie that binds an in-flight authorization
1364
1313
  * request to the browser that started it. Set at `GET /auth/authorize` (holding
@@ -1374,7 +1323,7 @@ declare class AuthorizeRuntime {
1374
1323
  * fails the match here, because the victim's browser never holds the secret. So
1375
1324
  * a handle can only be redeemed by the same browser that started the request.
1376
1325
  */
1377
- declare const AUTHZ_BINDING_COOKIE = "aooth_authz";
1326
+ export declare const AUTHZ_BINDING_COOKIE = "aooth_authz";
1378
1327
  /**
1379
1328
  * Cookie attributes for the authorize-binding cookie — the same httpOnly /
1380
1329
  * `SameSite=Lax` shape as the OAuth CSRF cookie (Lax, NOT Strict, so the
@@ -1386,12 +1335,10 @@ declare const AUTHZ_BINDING_COOKIE = "aooth_authz";
1386
1335
  * `ttlMs`. `secure` is caller-controlled (off for the http test harness, on in
1387
1336
  * production).
1388
1337
  */
1389
- declare function authzBindingCookieAttrs(opts: {
1338
+ export declare function authzBindingCookieAttrs(opts: {
1390
1339
  secure: boolean;
1391
1340
  maxAgeSec: number;
1392
1341
  }): TCookieAttributesInput;
1393
- //#endregion
1394
- //#region src/authz/authz-tokens.d.ts
1395
1342
  /**
1396
1343
  * Explicit string DI tokens for the ABSTRACT authorization-server stores
1397
1344
  * ({@link import("@aooth/auth/authz").PendingAuthorizationStore},
@@ -1416,15 +1363,15 @@ declare function authzBindingCookieAttrs(opts: {
1416
1363
  * )
1417
1364
  * ```
1418
1365
  */
1419
- declare const PENDING_AUTHORIZATION_STORE_TOKEN = "aooth:PendingAuthorizationStore";
1420
- declare const AUTH_CODE_STORE_TOKEN = "aooth:AuthCodeStore";
1366
+ export declare const PENDING_AUTHORIZATION_STORE_TOKEN = "aooth:PendingAuthorizationStore";
1367
+ export declare const AUTH_CODE_STORE_TOKEN = "aooth:AuthCodeStore";
1421
1368
  /**
1422
1369
  * DI token for the {@link import("@aooth/auth/authz").ClientRedirectPolicy} — an
1423
1370
  * interface, so it has no class reference to inject by. Provide the concrete
1424
1371
  * policy (e.g. `new LoopbackClientPolicy()`, a `RegisteredClientPolicy`, or a
1425
1372
  * `CompositeClientPolicy` of both) under this string.
1426
1373
  */
1427
- declare const CLIENT_REDIRECT_POLICY_TOKEN = "aooth:ClientRedirectPolicy";
1374
+ export declare const CLIENT_REDIRECT_POLICY_TOKEN = "aooth:ClientRedirectPolicy";
1428
1375
  /**
1429
1376
  * DI token for the {@link import("@aooth/auth/authz").DynamicClientStore}
1430
1377
  * (RFC 7591 dynamic registrations) — an abstract class, same auto-instantiation
@@ -1435,9 +1382,7 @@ declare const CLIENT_REDIRECT_POLICY_TOKEN = "aooth:ClientRedirectPolicy";
1435
1382
  * overrides `getDynamicClientRegistration()`. The same store instance also
1436
1383
  * backs the `DynamicClientPolicy` composed into the redirect policy.
1437
1384
  */
1438
- declare const DYNAMIC_CLIENT_STORE_TOKEN = "aooth:DynamicClientStore";
1439
- //#endregion
1440
- //#region src/workflow/auth-workflow.ctx.d.ts
1385
+ export declare const DYNAMIC_CLIENT_STORE_TOKEN = "aooth:DynamicClientStore";
1441
1386
  type MfaTransport = "sms" | "email" | "totp";
1442
1387
  /** Per-user MFA method summary surfaced to forms via `@wf.context.pass 'mfa'`. */
1443
1388
  interface MfaSummary {
@@ -2310,8 +2255,6 @@ interface AuthWfCtx {
2310
2255
  */
2311
2256
  public?: AuthWfPublicState;
2312
2257
  }
2313
- //#endregion
2314
- //#region src/workflow/auth-workflow.opts.d.ts
2315
2258
  interface AuthWorkflowOpts {
2316
2259
  autoLoginOnInvite?: boolean;
2317
2260
  autoLoginOnRecover?: boolean;
@@ -2539,8 +2482,6 @@ interface ResolvedAuthWorkflowOpts {
2539
2482
  authzConsent: TAtscriptAnnotatedType;
2540
2483
  };
2541
2484
  }
2542
- //#endregion
2543
- //#region src/workflow/auth-workflow.d.ts
2544
2485
  /**
2545
2486
  * Unified outbound-dispatch payload. Customers override `deliver(payload)` on
2546
2487
  * the `AuthWorkflow` subclass to route by `kind` (per-purpose templates) and
@@ -2608,12 +2549,12 @@ type AuthDeliveryPayload = {
2608
2549
  * declares one — or an attacker submits one as an extra field — the strip
2609
2550
  * applied at the workflow step blocks shadowing.
2610
2551
  */
2611
- declare const RESERVED_USER_KEYS: ReadonlySet<string>;
2552
+ export declare const RESERVED_USER_KEYS: ReadonlySet<string>;
2612
2553
  /**
2613
2554
  * Return a shallow copy of `profile` with `RESERVED_USER_KEYS` removed.
2614
2555
  * Does not mutate the input.
2615
2556
  */
2616
- declare function stripReservedUserKeys(profile: Record<string, unknown>): Record<string, unknown>;
2557
+ export declare function stripReservedUserKeys(profile: Record<string, unknown>): Record<string, unknown>;
2617
2558
  /**
2618
2559
  * Best-effort "Browser on OS" label from a raw User-Agent string — feeds the
2619
2560
  * `name` field of `seenDevices` records so a device list reads "Chrome on
@@ -2622,8 +2563,8 @@ declare function stripReservedUserKeys(profile: Record<string, unknown>): Record
2622
2563
  * Returns just the browser or just the OS when only one side is detected;
2623
2564
  * `undefined` for empty / fully unrecognized input.
2624
2565
  */
2625
- declare function humanizeUserAgent(ua: string | undefined): string | undefined;
2626
- declare function haversineKm(a: {
2566
+ export declare function humanizeUserAgent(ua: string | undefined): string | undefined;
2567
+ export declare function haversineKm(a: {
2627
2568
  lat: number;
2628
2569
  lon: number;
2629
2570
  }, b: {
@@ -2631,7 +2572,7 @@ declare function haversineKm(a: {
2631
2572
  lon: number;
2632
2573
  }): number;
2633
2574
  /** Trim + de-duplicate role identifiers submitted via the admin invite form. */
2634
- declare function parseInviteRoles(input?: string[]): string[];
2575
+ export declare function parseInviteRoles(input?: string[]): string[];
2635
2576
  /**
2636
2577
  * Single source of truth for the "this invite was already accepted" finish
2637
2578
  * envelope. Used by both `idempotent-redirect` (in-workflow) and by
@@ -2642,13 +2583,13 @@ declare function parseInviteRoles(input?: string[]): string[];
2642
2583
  * `alreadyAcceptedRedirectUrl` being non-empty — mirrors how the resolver
2643
2584
  * defaults it, but lets consumers blank it to suppress the secondary button.
2644
2585
  */
2645
- declare function buildInviteAlreadyAcceptedEnvelope(opts: {
2586
+ export declare function buildInviteAlreadyAcceptedEnvelope(opts: {
2646
2587
  loginUrl: string;
2647
2588
  alreadyAcceptedRedirectUrl: string;
2648
2589
  /** Text overrides (see `AuthWorkflowOpts.messages`). */
2649
2590
  messages?: AoothMessages;
2650
2591
  }): FinishWfOpts;
2651
- declare class AuthWorkflow {
2592
+ export declare class AuthWorkflow {
2652
2593
  protected readonly opts: ResolvedAuthWorkflowOpts;
2653
2594
  protected readonly users: UserService;
2654
2595
  protected readonly auth: AuthCredential;
@@ -4552,8 +4493,6 @@ declare class AuthWorkflow {
4552
4493
  */
4553
4494
  signupFlow(): void;
4554
4495
  }
4555
- //#endregion
4556
- //#region src/workflows/auth-email-outlet.d.ts
4557
4496
  interface AuthEmailOutletDeps {
4558
4497
  emailSender: EmailSender$1;
4559
4498
  buildMagicLinkUrl: BuildMagicLinkUrl$1;
@@ -4565,9 +4504,7 @@ interface AuthEmailOutletDeps {
4565
4504
  * `EmailSender`. Single-use: pass the same instance into one
4566
4505
  * `handleWfOutletRequest({ outlets })`.
4567
4506
  */
4568
- declare function createAuthEmailOutlet(deps: AuthEmailOutletDeps): WfOutlet;
4569
- //#endregion
4570
- //#region src/audit/index.d.ts
4507
+ export declare function createAuthEmailOutlet(deps: AuthEmailOutletDeps): WfOutlet;
4571
4508
  /**
4572
4509
  * Audit event emitter — used by `AuthWorkflow`'s audit-login step (and
4573
4510
  * future recovery / invite audit steps) to fan out login.success and similar
@@ -4593,5 +4530,4 @@ interface AuditEvent {
4593
4530
  interface AuditEmitter {
4594
4531
  emit(event: AuditEvent): Promise<void> | void;
4595
4532
  }
4596
- //#endregion
4597
- export { ADD_MFA_WORKFLOW, AOOTH_MESSAGES, AUTHZ_BINDING_COOKIE, AUTH_CODE_STORE_TOKEN, type AoothMessageCode, type AoothMessageParams, type AoothMessages, type AuditEmitter, type AuditEvent, type AuthBindings, type AuthContext, AuthController, type AuthDeliveryPayload, type AuthEmailEvent, type AuthEmailKind, type AuthEmailOutletDeps, AuthGuarded, type AuthLoginResponse, type AuthLogoutBody, type AuthOkResponse, type AuthOptions, type AuthRefreshBody, type AuthSmsEvent, type AuthSmsKind, type AuthWfCompletionState, type AuthWfConsentsState, type AuthWfCtx, type AuthWfMfaEnrollState, type AuthWfOAuthState, type AuthWfPasswordUiState, type AuthWfPincodeUiState, AuthWorkflow, type AuthWorkflowOpts, type AuthorizationServerMetadata, AuthorizeController, AuthorizeRuntime, type AuthzReauthPolicy, type BuildAuthorizationServerMetadataOptions, type BuildMagicLinkUrl, type BuildProtectedResourceMetadataOptions, CHANGE_PASSWORD_WORKFLOW, CLIENT_REDIRECT_POLICY_TOKEN, type ConcurrencyLimitOptions, type ConnectedAccount, type ConsentDescriptor, type ConsentDescriptorLike, type ConsentEvent, ConsentStore, DEFAULT_AUTH_WORKFLOWS, DYNAMIC_CLIENT_STORE_TOKEN, DynamicClientRegistration, type DynamicClientRegistrationOptions, type EmailSender, type EnrichedSession, FEDERATED_IDENTITY_STORE_TOKEN, INVITE_OUTLET, type IssueResult, type LoginRedirect, type MfaSummary, type MfaTransport, OAUTH_CSRF_COOKIE, OAuthController, OAuthRuntime, PENDING_AUTHORIZATION_STORE_TOKEN, type ProtectedResourceMetadata, Public, RESERVED_USER_KEYS, RateLimit, type RateLimitBindings, type RateLimitDecision, type RateLimitDecoratorOptions, type RateLimitInterceptorOptions, type RateLimitKeyStrategy, type RateLimitRule, type RateLimitRuleInput, type RateLimitStore, RateLimitStoreMemory, RateLimited, RateLimiter, type RateLimiterOptions, type ResolvedAuthCookieConfig, type ResolvedAuthOptions, type ResolvedAuthWorkflowOpts, type SessionEnricher, SessionEnricherProvider, type SessionInfo, SessionsController, type SmsSender, type SsoProvider, type TAuthMeta, type TRateLimitMeta, UserId, WfTrigger, type WfTriggerOpts, WfTriggerProvider, type WwwAuthenticateBearerChallengeOptions, authGuardInterceptor, authzBindingCookieAttrs, buildAuthorizationServerMetadata, buildInviteAlreadyAcceptedEnvelope, buildProtectedResourceMetadata, buildWwwAuthenticateBearerChallenge, canonicalizeIssuer, createAuthEmailOutlet, createInviteOutlet, deriveWfStateSecret, generateMagicLinkToken, getAuthMate, getRateLimitMate, getRateLimitSubject, haversineKm, humanizeUserAgent, isSafeRelativeRedirect, oauthCsrfCookieAttrs, parseInviteRoles, rateLimitInterceptors, renderAoothMessage, resolveAoothMessage, resolveOAuthRedirect, setRateLimitSubject, stripReservedUserKeys, useAuth, useRateLimit };
4533
+ export { type AoothMessageCode, type AoothMessageParams, type AoothMessages, type AuditEmitter, type AuditEvent, type AuthBindings, type AuthContext, type AuthDeliveryPayload, type AuthEmailEvent, type AuthEmailKind, type AuthEmailOutletDeps, type AuthLoginResponse, type AuthLogoutBody, type AuthOkResponse, type AuthOptions, type AuthRefreshBody, type AuthSmsEvent, type AuthSmsKind, type AuthWfCompletionState, type AuthWfConsentsState, type AuthWfCtx, type AuthWfMfaEnrollState, type AuthWfOAuthState, type AuthWfPasswordUiState, type AuthWfPincodeUiState, type AuthWorkflowOpts, type AuthorizationServerMetadata, type AuthzReauthPolicy, type BuildAuthorizationServerMetadataOptions, type BuildMagicLinkUrl, type BuildProtectedResourceMetadataOptions, type ConcurrencyLimitOptions, type ConnectedAccount, type ConsentDescriptor, type ConsentDescriptorLike, type ConsentEvent, DynamicClientRegistration, type DynamicClientRegistrationOptions, type EmailSender, type EnrichedSession, type IssueResult, type LoginRedirect, type MfaSummary, type MfaTransport, type ProtectedResourceMetadata, type RateLimitBindings, type RateLimitDecision, type RateLimitDecoratorOptions, type RateLimitInterceptorOptions, type RateLimitKeyStrategy, type RateLimitRule, type RateLimitRuleInput, type RateLimitStore, RateLimitStoreMemory, RateLimiter, type RateLimiterOptions, type ResolvedAuthCookieConfig, type ResolvedAuthOptions, type ResolvedAuthWorkflowOpts, type SessionEnricher, type SessionInfo, type SmsSender, type SsoProvider, type TAuthMeta, type TRateLimitMeta, type WfTriggerOpts, type WwwAuthenticateBearerChallengeOptions, buildAuthorizationServerMetadata, buildProtectedResourceMetadata, buildWwwAuthenticateBearerChallenge, canonicalizeIssuer, generateMagicLinkToken };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as RemoveMfaConfirmForm, D as StepUpConfirmForm, E as SignupForm, O as TermsBumpForm, T as SetPasswordForm, _ as PasswordReauthForm, a as ConcurrencyLimitForm, b as ProveControlOtpForm, c as EnrollConfirmForm, d as InviteChooseUsernameForm, f as InviteForm, g as MfaCodeForm, h as ManageMfaForm, i as ChangePasswordForm, l as EnrollPickMethodForm, n as AskPhoneForm, o as EmailIdentifierForm, p as LoginCredentialsForm, r as AuthorizeConsentForm, s as EnrollAddressForm, t as AskEmailForm, u as EnrollTotpQrForm, v as PincodeForm, w as Select2faForm, y as ProveControlForm } from "./forms-DDn6m5rP.mjs";
1
+ import { C as RemoveMfaConfirmForm, D as StepUpConfirmForm, E as SignupForm, O as TermsBumpForm, T as SetPasswordForm, _ as PasswordReauthForm, a as ConcurrencyLimitForm, b as ProveControlOtpForm, c as EnrollConfirmForm, d as InviteChooseUsernameForm, f as InviteForm, g as MfaCodeForm, h as ManageMfaForm, i as ChangePasswordForm, l as EnrollPickMethodForm, n as AskPhoneForm, o as EmailIdentifierForm, p as LoginCredentialsForm, r as AuthorizeConsentForm, s as EnrollAddressForm, t as AskEmailForm, u as EnrollTotpQrForm, v as PincodeForm, w as Select2faForm, y as ProveControlForm } from "./forms-C_VNxSDn.mjs";
2
2
  import { Controller, HandlerPaths, Inherit, Inject, InjectMoostLogger, Injectable, Intercept, MoostInit, Optional, Param, Resolve, TInterceptorPriority, defineAfterInterceptor, defineBeforeInterceptor, getMoostMate, useControllerContext, useLogger } from "moost";
3
3
  import { AuthCredential, AuthError, RateLimitStoreMemory, RateLimitStoreMemory as RateLimitStoreMemory$1, RateLimiter, RateLimiter as RateLimiter$1, generateMagicLinkToken, generateOpaqueToken, parseRateLimitRule, pickGoverning } from "@aooth/auth";
4
4
  import { current, defineWook, eventTypeKey, key } from "@wooksjs/event-core";
@@ -11,15 +11,14 @@ import { createAsHttpOutlet, finishWf, handleAsOutletRequest, useAtscriptWf } fr
11
11
  import { EncapsulatedStateStrategy, MoostWf, Step, StepRetriableError, StepTTL, Workflow, WorkflowParam, WorkflowSchema, createEmailOutlet, outlet, outletEmail, swapStrategy, useWfFinished, useWfState } from "@moostjs/event-wf";
12
12
  import { FederatedLoginService, OAuthError, OAuthProviderRegistry, generateRandomState, pkceChallengeFor } from "@aooth/idp";
13
13
  import { ClientRegistrationError, DynamicClientRegistration, NoopOidcClaimsResolver, buildAuthorizationServerMetadata, buildAuthorizationServerMetadata as buildAuthorizationServerMetadata$1, buildProtectedResourceMetadata, buildWwwAuthenticateBearerChallenge, canonicalizeIssuer, canonicalizeIssuer as canonicalizeIssuer$1, tokenPolicyToIssueOptions } from "@aooth/auth/authz";
14
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
14
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/decorate.js
15
15
  function __decorate(decorators, target, key, desc) {
16
16
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
17
17
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
18
18
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
19
19
  return c > 3 && r && Object.defineProperty(target, key, r), r;
20
20
  }
21
- //#endregion
22
- //#region src/consent.store.ts
21
+ // src/consent.store.ts
23
22
  let ConsentStore = class ConsentStore {
24
23
  /**
25
24
  * Returns descriptors for general-purpose consents this user still needs to
@@ -60,8 +59,7 @@ let ConsentStore = class ConsentStore {
60
59
  async recordOtpChannelConsent(_username, _channel, _target, _disclosure) {}
61
60
  };
62
61
  ConsentStore = __decorate([Injectable()], ConsentStore);
63
- //#endregion
64
- //#region src/auth.config.ts
62
+ // src/auth.config.ts
65
63
  /**
66
64
  * Resolve `AuthOptions` to its `ResolvedAuthOptions` form, applying the same
67
65
  * defaults the legacy `MoostAuthConfig` constructor did. Pure — call once per
@@ -97,8 +95,7 @@ function resolveAuthOptions(opts = {}) {
97
95
  exposeTokensInBody: opts.exposeTokensInBody ?? !enableCookie
98
96
  };
99
97
  }
100
- //#endregion
101
- //#region src/auth.composables.ts
98
+ // src/auth.composables.ts
102
99
  const authContextKey = key("auth.context");
103
100
  const authCredentialKey = key("auth.credential");
104
101
  /**
@@ -271,8 +268,7 @@ function setAuthContext(ctx, value) {
271
268
  function setAuthCredential(ctx, value) {
272
269
  ctx.set(authCredentialKey, value);
273
270
  }
274
- //#endregion
275
- //#region src/auth.route.ts
271
+ // src/auth.route.ts
276
272
  /**
277
273
  * Normalize a router path into a value usable as a cookie `Path` attribute:
278
274
  * a single leading slash, no doubled slashes, and no trailing slash (except
@@ -286,8 +282,7 @@ let RefreshCookiePathHolder = class RefreshCookiePathHolder {
286
282
  path;
287
283
  };
288
284
  RefreshCookiePathHolder = __decorate([Injectable()], RefreshCookiePathHolder);
289
- //#endregion
290
- //#region src/auth.guard.ts
285
+ // src/auth.guard.ts
291
286
  /**
292
287
  * `GUARD`-priority interceptor factory that authenticates incoming requests.
293
288
  *
@@ -356,13 +351,11 @@ function authGuardInterceptor(opts) {
356
351
  function AuthGuarded(opts) {
357
352
  return Intercept(authGuardInterceptor(opts));
358
353
  }
359
- //#endregion
360
- //#region src/auth.mate.ts
354
+ // src/auth.mate.ts
361
355
  function getAuthMate() {
362
356
  return getMoostMate();
363
357
  }
364
- //#endregion
365
- //#region src/auth.decorator.ts
358
+ // src/auth.decorator.ts
366
359
  /**
367
360
  * Marks a route or controller as fully public — opts out of BOTH
368
361
  * authentication (auth-moost's bearer guard) AND authorization
@@ -392,8 +385,7 @@ const Public = () => {
392
385
  * does not own a user profile type.
393
386
  */
394
387
  const UserId = () => Resolve(() => useAuth().getUserId());
395
- //#endregion
396
- //#region src/rate-limit/composables.ts
388
+ // src/rate-limit/composables.ts
397
389
  /**
398
390
  * Internal: the governing decision for this event (across every policy
399
391
  * evaluated so far), written by `rateLimitInterceptors`.
@@ -431,8 +423,7 @@ function getRateLimitSubject(kind, ctx = current()) {
431
423
  function useRateLimit(ctx = current()) {
432
424
  return { decision: ctx.has(rateLimitDecisionKey) ? ctx.get(rateLimitDecisionKey) : null };
433
425
  }
434
- //#endregion
435
- //#region src/rate-limit/interceptor.ts
426
+ // src/rate-limit/interceptor.ts
436
427
  /**
437
428
  * Global interceptor PAIR enforcing `@RateLimit` metadata (RL.spec.md §5.2)
438
429
  * — register with spread:
@@ -569,13 +560,11 @@ function clientIp(trustProxy, ctx) {
569
560
  const req = useRequest(ctx);
570
561
  return trustProxy ? resolveForwarded(req.raw, trustOneHop).ip : req.getIp();
571
562
  }
572
- //#endregion
573
- //#region src/rate-limit/mate.ts
563
+ // src/rate-limit/mate.ts
574
564
  function getRateLimitMate() {
575
565
  return getMoostMate();
576
566
  }
577
- //#endregion
578
- //#region src/rate-limit/decorator.ts
567
+ // src/rate-limit/decorator.ts
579
568
  function RateLimit(...args) {
580
569
  const mate = getRateLimitMate();
581
570
  if (args.length === 1 && args[0] === false) return mate.decorate("rateLimitDisabled", true);
@@ -610,8 +599,7 @@ function RateLimited(opts) {
610
599
  interceptPost(target, key, descriptor);
611
600
  });
612
601
  }
613
- //#endregion
614
- //#region src/workflow/invite-outlet.ts
602
+ // src/workflow/invite-outlet.ts
615
603
  /** Name of the outlet `AuthWorkflow` pauses on for `inviteDelivery: 'deliver' | 'return-link'`. */
616
604
  const INVITE_OUTLET = "invite";
617
605
  const pendingInviteLinkKey = key("aooth.invite.pendingLink");
@@ -647,13 +635,11 @@ function createInviteOutlet() {
647
635
  }
648
636
  };
649
637
  }
650
- //#endregion
651
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateMetadata.js
638
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/decorateMetadata.js
652
639
  function __decorateMetadata(k, v) {
653
640
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
654
641
  }
655
- //#endregion
656
- //#region src/wf-trigger/provider.ts
642
+ // src/wf-trigger/provider.ts
657
643
  /**
658
644
  * Derive the exact 32-byte key the encapsulated wf-state strategy requires from
659
645
  * an arbitrary-length app secret.
@@ -804,8 +790,7 @@ let WfTriggerProvider = class WfTriggerProvider {
804
790
  }
805
791
  };
806
792
  WfTriggerProvider = __decorate([Injectable(), __decorateMetadata("design:paramtypes", [typeof MoostWf === "undefined" ? Object : MoostWf, typeof AuthCredential === "undefined" ? Object : AuthCredential])], WfTriggerProvider);
807
- //#endregion
808
- //#region src/wf-trigger/decorator.ts
793
+ // src/wf-trigger/decorator.ts
809
794
  /**
810
795
  * Method decorator that turns a handler into a workflow trigger.
811
796
  *
@@ -859,8 +844,7 @@ async function buildOAuthAuthorizeRequest(registry, provider, input) {
859
844
  })
860
845
  };
861
846
  }
862
- //#endregion
863
- //#region src/oauth/oauth-csrf.ts
847
+ // src/oauth/oauth-csrf.ts
864
848
  /**
865
849
  * Name of the double-submit anti-CSRF cookie set at `/:provider/start` and
866
850
  * verified in `oauth-exchange`. Holds the signed-state `random`; the callback
@@ -902,8 +886,7 @@ function safeEqual(a, b) {
902
886
  if (ab.length !== bb.length) return false;
903
887
  return timingSafeEqual(ab, bb);
904
888
  }
905
- //#endregion
906
- //#region src/authz/authz-binding.ts
889
+ // src/authz/authz-binding.ts
907
890
  /**
908
891
  * Name of the double-submit cookie that binds an in-flight authorization
909
892
  * request to the browser that started it. Set at `GET /auth/authorize` (holding
@@ -937,8 +920,7 @@ function authzBindingCookieAttrs(opts) {
937
920
  maxAgeSec: opts.maxAgeSec
938
921
  });
939
922
  }
940
- //#endregion
941
- //#region src/authz/authz-redirect.ts
923
+ // src/authz/authz-redirect.ts
942
924
  /**
943
925
  * Build the client redirect URL for an authorization-server result (RFC 6749
944
926
  * §4.1.2 / §4.1.2.1): append the result params (`code` on success, `error` on
@@ -952,8 +934,7 @@ function authzRedirectUrl(redirectUri, params) {
952
934
  for (const [key, value] of Object.entries(params)) if (value !== void 0) url.searchParams.set(key, value);
953
935
  return url.toString();
954
936
  }
955
- //#endregion
956
- //#region src/oauth/oauth-redirect.ts
937
+ // src/oauth/oauth-redirect.ts
957
938
  /**
958
939
  * Open-redirect defense for the post-login `redirect` carried across the OAuth
959
940
  * bounce (RFC IDP.md §7). The provider round-trips whatever target the SPA
@@ -988,8 +969,7 @@ function isSafeRelativeRedirect(target) {
988
969
  function resolveOAuthRedirect(requested, fallback) {
989
970
  return isSafeRelativeRedirect(requested) ? requested : fallback;
990
971
  }
991
- //#endregion
992
- //#region src/authz/authz-tokens.ts
972
+ // src/authz/authz-tokens.ts
993
973
  /**
994
974
  * Explicit string DI tokens for the ABSTRACT authorization-server stores
995
975
  * ({@link import("@aooth/auth/authz").PendingAuthorizationStore},
@@ -1034,15 +1014,13 @@ const CLIENT_REDIRECT_POLICY_TOKEN = "aooth:ClientRedirectPolicy";
1034
1014
  * backs the `DynamicClientPolicy` composed into the redirect policy.
1035
1015
  */
1036
1016
  const DYNAMIC_CLIENT_STORE_TOKEN = "aooth:DynamicClientStore";
1037
- //#endregion
1038
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
1017
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/decorateParam.js
1039
1018
  function __decorateParam(paramIndex, decorator) {
1040
1019
  return function(target, key) {
1041
1020
  decorator(target, key, paramIndex);
1042
1021
  };
1043
1022
  }
1044
- //#endregion
1045
- //#region src/authz/authorize-runtime.ts
1023
+ // src/authz/authorize-runtime.ts
1046
1024
  let AuthorizeRuntime = class AuthorizeRuntime {
1047
1025
  pending;
1048
1026
  codes;
@@ -1057,8 +1035,7 @@ AuthorizeRuntime = __decorate([
1057
1035
  __decorateParam(1, Inject(AUTH_CODE_STORE_TOKEN)),
1058
1036
  __decorateMetadata("design:paramtypes", [Object, Object])
1059
1037
  ], AuthorizeRuntime);
1060
- //#endregion
1061
- //#region src/oauth/oauth-runtime.ts
1038
+ // src/oauth/oauth-runtime.ts
1062
1039
  let OAuthRuntime = class OAuthRuntime {
1063
1040
  registry;
1064
1041
  federated;
@@ -1068,8 +1045,7 @@ let OAuthRuntime = class OAuthRuntime {
1068
1045
  }
1069
1046
  };
1070
1047
  OAuthRuntime = __decorate([Injectable(), __decorateMetadata("design:paramtypes", [typeof OAuthProviderRegistry === "undefined" ? Object : OAuthProviderRegistry, typeof FederatedLoginService === "undefined" ? Object : FederatedLoginService])], OAuthRuntime);
1071
- //#endregion
1072
- //#region src/workflow/auth-messages.ts
1048
+ // src/workflow/auth-messages.ts
1073
1049
  /**
1074
1050
  * Code-keyed catalogue of every user-facing text `AuthWorkflow` produces —
1075
1051
  * form errors, banners, finish envelopes and button labels. Templates are
@@ -1141,8 +1117,7 @@ function resolveAoothMessage(code, params = {}, messages) {
1141
1117
  } else if (messages?.[code] !== void 0) return renderAoothMessage(messages[code], params);
1142
1118
  return renderAoothMessage(AOOTH_MESSAGES[code], params);
1143
1119
  }
1144
- //#endregion
1145
- //#region src/workflow/auth-workflow.schemas.ts
1120
+ // src/workflow/auth-workflow.schemas.ts
1146
1121
  /**
1147
1122
  * Canonical OTP send-then-check pair. Used by:
1148
1123
  * - Login's MFA-loop SMS/email challenge sub-branch (the outer MFA while provides iteration)
@@ -1312,8 +1287,7 @@ const consentsPersistTailSchema = [{
1312
1287
  id: "persist-consents",
1313
1288
  condition: (ctx) => (ctx.consents?.pending?.length ?? 0) > 0 && !!ctx.consents?.decidedAt
1314
1289
  }];
1315
- //#endregion
1316
- //#region src/workflow/auth-workflow.ts
1290
+ // src/workflow/auth-workflow.ts
1317
1291
  /**
1318
1292
  * Unified `AuthWorkflow` — single concrete class with three `@Workflow`
1319
1293
  * methods (`loginFlow`, `inviteFlow`, `recoveryFlow`) replacing the prior
@@ -1383,7 +1357,7 @@ const warnedOnce = {
1383
1357
  crossIssuerReuse: false
1384
1358
  };
1385
1359
  /** Sliding lifetime of a shadow failure counter (and of a shadow "permanent" lock). */
1386
- const SHADOW_TTL_MS = 720 * 60 * 6e4;
1360
+ const SHADOW_TTL_MS = 2592e6;
1387
1361
  /** Key prefix of an active shadow lock (kept longest by the default store). */
1388
1362
  const SHADOW_LOCK_PREFIX = "shadow-lock:";
1389
1363
  /** Cap of the default (process-wide, in-memory) shadow-lockout store. */
@@ -1399,7 +1373,7 @@ function defaultShadowStore() {
1399
1373
  function mergeAuthWorkflowOpts(opts) {
1400
1374
  const deviceTrust = {
1401
1375
  cookieName: "aooth_trusted_device",
1402
- ttlMs: 1440 * 6e4,
1376
+ ttlMs: 864e5,
1403
1377
  bindsTo: "cookie",
1404
1378
  ...opts.deviceTrust
1405
1379
  };
@@ -1416,17 +1390,17 @@ function mergeAuthWorkflowOpts(opts) {
1416
1390
  lockoutShadowStore: opts.lockoutShadowStore ?? defaultShadowStore(),
1417
1391
  mfa: {
1418
1392
  pincodeLength: opts.mfa?.pincodeLength ?? 6,
1419
- pincodeTtlMs: opts.mfa?.pincodeTtlMs ?? 300 * 1e3,
1393
+ pincodeTtlMs: opts.mfa?.pincodeTtlMs ?? 3e5,
1420
1394
  pincodeResendTimeoutMs: opts.mfa?.pincodeResendTimeoutMs ?? 6e4,
1421
1395
  pincodeMaxAttempts: opts.mfa?.pincodeMaxAttempts ?? 5
1422
1396
  },
1423
- recoveryStateTtlMs: opts.recoveryStateTtlMs ?? 3600 * 1e3,
1397
+ recoveryStateTtlMs: opts.recoveryStateTtlMs ?? 36e5,
1424
1398
  loginUrl: opts.loginUrl ?? "/login",
1425
1399
  totpIssuer: opts.totpIssuer ?? "aooth",
1426
1400
  deviceTrust,
1427
1401
  deviceRecognition: {
1428
1402
  cookieName: opts.deviceRecognition?.cookieName ?? `${deviceTrust.cookieName}_seen`,
1429
- ttlMs: opts.deviceRecognition?.ttlMs ?? 4320 * 60 * 6e4,
1403
+ ttlMs: opts.deviceRecognition?.ttlMs ?? 15552e6,
1430
1404
  maxDevices: opts.deviceRecognition?.maxDevices ?? SEEN_DEVICES_DEFAULT_CAP
1431
1405
  },
1432
1406
  forms: {
@@ -1571,7 +1545,7 @@ const ALT_HANDLED = Symbol("ALT_HANDLED");
1571
1545
  * industry-standard invite-link window (Slack/GitHub/Atlassian). Override by
1572
1546
  * re-decorating the step in a subclass.
1573
1547
  */
1574
- const INVITE_LINK_TTL_MS = 10080 * 60 * 1e3;
1548
+ const INVITE_LINK_TTL_MS = 6048e5;
1575
1549
  /** One canonical form of a chosen username: Unicode NFKC, surrounding whitespace trimmed. */
1576
1550
  function normalizeUsername(raw) {
1577
1551
  return String(raw).normalize("NFKC").trim();
@@ -3113,11 +3087,12 @@ let AuthWorkflow = _AuthWorkflow = class AuthWorkflow {
3113
3087
  */
3114
3088
  async handleCredentialsAlt(action, typedUsername, alt, authzHandle) {
3115
3089
  if (action === "forgotPassword" && alt.forgotPassword) {
3090
+ const url = this.resolveRecoveryUrl(typedUsername, alt);
3116
3091
  finishWf({ next: {
3117
3092
  trigger: "immediate",
3118
3093
  action: {
3119
3094
  type: "redirect",
3120
- target: this.resolveRecoveryUrl(typedUsername, alt),
3095
+ target: url,
3121
3096
  reason: "forgot-password"
3122
3097
  }
3123
3098
  } });
@@ -7034,8 +7009,7 @@ AuthWorkflow = _AuthWorkflow = __decorate([
7034
7009
  typeof ConsentStore === "undefined" ? Object : ConsentStore
7035
7010
  ])
7036
7011
  ], AuthWorkflow);
7037
- //#endregion
7038
- //#region src/auth.controller.ts
7012
+ // src/auth.controller.ts
7039
7013
  /** Workflows allowed by the bundled `/auth/trigger` endpoint. Subclasses override `triggerWf()` to extend. */
7040
7014
  const DEFAULT_AUTH_WORKFLOWS = [
7041
7015
  "auth/login/flow",
@@ -7283,8 +7257,7 @@ AuthController = __decorate([
7283
7257
  __decorateParam(1, Optional()),
7284
7258
  __decorateMetadata("design:paramtypes", [typeof AuthCredential === "undefined" ? Object : AuthCredential, typeof UserService === "undefined" ? Object : UserService])
7285
7259
  ], AuthController);
7286
- //#endregion
7287
- //#region src/sessions.controller.ts
7260
+ // src/sessions.controller.ts
7288
7261
  let SessionEnricherProvider = class SessionEnricherProvider {
7289
7262
  enrich(session) {
7290
7263
  return session;
@@ -7375,8 +7348,7 @@ SessionsController = __decorate([
7375
7348
  ArbacResource("auth.sessions"),
7376
7349
  __decorateMetadata("design:paramtypes", [typeof AuthCredential === "undefined" ? Object : AuthCredential, typeof SessionEnricherProvider === "undefined" ? Object : SessionEnricherProvider])
7377
7350
  ], SessionsController);
7378
- //#endregion
7379
- //#region src/oauth/oauth-tokens.ts
7351
+ // src/oauth/oauth-tokens.ts
7380
7352
  /**
7381
7353
  * Explicit string DI token for the ABSTRACT `FederatedIdentityStore`.
7382
7354
  *
@@ -7398,8 +7370,7 @@ SessionsController = __decorate([
7398
7370
  * ```
7399
7371
  */
7400
7372
  const FEDERATED_IDENTITY_STORE_TOKEN = "aooth:FederatedIdentityStore";
7401
- //#endregion
7402
- //#region src/oauth/oauth.controller.ts
7373
+ // src/oauth/oauth.controller.ts
7403
7374
  let OAuthController = class OAuthController {
7404
7375
  registry;
7405
7376
  auth;
@@ -7583,8 +7554,7 @@ function toConnectedAccount(i) {
7583
7554
  ...i.avatarUrl !== void 0 && { avatarUrl: i.avatarUrl }
7584
7555
  };
7585
7556
  }
7586
- //#endregion
7587
- //#region src/authz/authorize.controller.ts
7557
+ // src/authz/authorize.controller.ts
7588
7558
  /** Shared default claims resolver — stateless, so one instance is reused across requests. */
7589
7559
  const NOOP_OIDC_CLAIMS_RESOLVER = new NoopOidcClaimsResolver();
7590
7560
  let AuthorizeController = class AuthorizeController {
@@ -8069,8 +8039,7 @@ AuthorizeController = __decorate([
8069
8039
  function expiresInSeconds(expiresAt) {
8070
8040
  return Math.max(0, Math.floor((expiresAt - Date.now()) / 1e3));
8071
8041
  }
8072
- //#endregion
8073
- //#region src/workflows/auth-email-outlet.ts
8042
+ // src/workflows/auth-email-outlet.ts
8074
8043
  /**
8075
8044
  * Build the email outlet that delivers magic links via the consumer's
8076
8045
  * `EmailSender`. Single-use: pass the same instance into one
@@ -8097,5 +8066,4 @@ function createAuthEmailOutlet(deps) {
8097
8066
  await deps.emailSender.send(event);
8098
8067
  });
8099
8068
  }
8100
- //#endregion
8101
8069
  export { ADD_MFA_WORKFLOW, AOOTH_MESSAGES, AUTHZ_BINDING_COOKIE, AUTH_CODE_STORE_TOKEN, AuthController, AuthGuarded, AuthWorkflow, AuthorizeController, AuthorizeRuntime, CHANGE_PASSWORD_WORKFLOW, CLIENT_REDIRECT_POLICY_TOKEN, ConsentStore, DEFAULT_AUTH_WORKFLOWS, DYNAMIC_CLIENT_STORE_TOKEN, DynamicClientRegistration, FEDERATED_IDENTITY_STORE_TOKEN, INVITE_OUTLET, OAUTH_CSRF_COOKIE, OAuthController, OAuthRuntime, PENDING_AUTHORIZATION_STORE_TOKEN, Public, RESERVED_USER_KEYS, RateLimit, RateLimitStoreMemory, RateLimited, RateLimiter, SessionEnricherProvider, SessionsController, UserId, WfTrigger, WfTriggerProvider, authGuardInterceptor, authzBindingCookieAttrs, buildAuthorizationServerMetadata, buildInviteAlreadyAcceptedEnvelope, buildProtectedResourceMetadata, buildWwwAuthenticateBearerChallenge, canonicalizeIssuer, createAuthEmailOutlet, createInviteOutlet, deriveWfStateSecret, generateMagicLinkToken, getAuthMate, getRateLimitMate, getRateLimitSubject, haversineKm, humanizeUserAgent, isSafeRelativeRedirect, oauthCsrfCookieAttrs, parseInviteRoles, rateLimitInterceptors, renderAoothMessage, resolveAoothMessage, resolveOAuthRedirect, setRateLimitSubject, stripReservedUserKeys, useAuth, useRateLimit };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aooth/auth-moost",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Moost auth integration for aoothjs — AuthGuard interceptor, useAuth composable, REST endpoints, workflows",
5
5
  "keywords": [
6
6
  "aoothjs",
@@ -57,33 +57,33 @@
57
57
  "access": "public"
58
58
  },
59
59
  "dependencies": {
60
- "@atscript/moost-wf": "^0.1.162",
60
+ "@atscript/moost-wf": "^0.1.163",
61
61
  "@wooksjs/http-body": "^0.8.0",
62
- "@aooth/arbac-moost": "^0.2.1",
63
- "@aooth/auth": "0.2.1",
64
- "@aooth/idp": "0.2.1",
65
- "@aooth/user": "0.2.1"
62
+ "@aooth/arbac-moost": "^0.2.2",
63
+ "@aooth/auth": "0.2.2",
64
+ "@aooth/idp": "0.2.2",
65
+ "@aooth/user": "0.2.2"
66
66
  },
67
67
  "devDependencies": {
68
- "@atscript/core": "^0.2.1",
69
- "@atscript/typescript": "^0.2.1",
70
- "@atscript/ui": "^0.1.162",
71
- "@atscript/ui-fns": "^0.1.162",
72
- "@moostjs/event-http": "^0.7.0",
73
- "@moostjs/event-wf": "^0.7.0",
74
- "moost": "^0.7.0",
75
- "unplugin-atscript": "^0.2.1",
68
+ "@atscript/core": "^0.2.3",
69
+ "@atscript/typescript": "^0.2.3",
70
+ "@atscript/ui": "^0.1.163",
71
+ "@atscript/ui-fns": "^0.1.163",
72
+ "@moostjs/event-http": "^0.7.1",
73
+ "@moostjs/event-wf": "^0.7.1",
74
+ "moost": "^0.7.1",
75
+ "unplugin-atscript": "^0.2.3",
76
76
  "wooks": "^0.8.0"
77
77
  },
78
78
  "peerDependencies": {
79
- "@atscript/moost-wf": "^0.1.162",
80
- "@atscript/typescript": "^0.2.1",
81
- "@moostjs/event-http": "^0.7.0",
82
- "@moostjs/event-wf": "^0.7.0",
79
+ "@atscript/moost-wf": "^0.1.163",
80
+ "@atscript/typescript": "^0.2.3",
81
+ "@moostjs/event-http": "^0.7.1",
82
+ "@moostjs/event-wf": "^0.7.1",
83
83
  "@wooksjs/event-core": "^0.8.0",
84
84
  "@wooksjs/event-http": "^0.8.0",
85
85
  "@wooksjs/http-body": "^0.8.0",
86
- "moost": "^0.7.0"
86
+ "moost": "^0.7.1"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "@atscript/typescript": {