@aooth/auth-moost 0.1.57 → 0.1.59

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,5 +1,4 @@
1
1
  import { TAtscriptAnnotatedType, TAtscriptTypeObject, TMetadataMap, TValidatorOptions, Validator } from "@atscript/typescript/utils";
2
-
3
2
  //#region src/atscript/models/forms.as.d.ts
4
3
  /**
5
4
  * Atscript interface **WithInlineConsentForm**
@@ -22,7 +21,8 @@ declare class WithInlineConsentForm {
22
21
  */
23
22
  declare class LoginCredentialsForm {
24
23
  username: string;
25
- password: string; // signup: ui.action
24
+ password: string;
25
+ // signup: ui.action
26
26
  // magicLink: ui.action
27
27
  ssoProvider?: string;
28
28
  static __is_atscript_annotated_type: true;
@@ -40,7 +40,8 @@ declare class LoginCredentialsForm {
40
40
  */
41
41
  declare class MfaCodeForm {
42
42
  // transportHint: ui.paragraph
43
- code: string; // useDifferentMethod: ui.action
43
+ code: string;
44
+ // useDifferentMethod: ui.action
44
45
  rememberDevice: boolean;
45
46
  static __is_atscript_annotated_type: true;
46
47
  static type: TAtscriptTypeObject<keyof MfaCodeForm, MfaCodeForm>;
@@ -56,8 +57,7 @@ declare class MfaCodeForm {
56
57
  * @see {@link ./forms.as:173:18}
57
58
  */
58
59
  declare class EmailIdentifierForm {
59
- email: string;
60
- /* email */
60
+ email: string; /* email */
61
61
  // backToLogin: ui.action
62
62
  static __is_atscript_annotated_type: true;
63
63
  static type: TAtscriptTypeObject<keyof EmailIdentifierForm, EmailIdentifierForm>;
@@ -73,8 +73,7 @@ declare class EmailIdentifierForm {
73
73
  * @see {@link ./forms.as:205:18}
74
74
  */
75
75
  declare class SignupForm {
76
- email: string;
77
- /* email */
76
+ email: string; /* email */
78
77
  // backToLogin: ui.action
79
78
  static __is_atscript_annotated_type: true;
80
79
  static type: TAtscriptTypeObject<keyof SignupForm, SignupForm>;
@@ -92,7 +91,8 @@ declare class SignupForm {
92
91
  declare class SetPasswordForm extends WithInlineConsentForm {
93
92
  // intro: ui.paragraph
94
93
  newPassword: string;
95
- confirmPassword: string; // passwordRules: ui.paragraph
94
+ confirmPassword: string;
95
+ // passwordRules: ui.paragraph
96
96
  static __is_atscript_annotated_type: true;
97
97
  static type: TAtscriptTypeObject<keyof SetPasswordForm, SetPasswordForm>;
98
98
  static metadata: TMetadataMap<AtscriptMetadata>;
@@ -107,8 +107,7 @@ declare class SetPasswordForm extends WithInlineConsentForm {
107
107
  * @see {@link ./forms.as:341:18}
108
108
  */
109
109
  declare class InviteForm {
110
- email: string;
111
- /* email */
110
+ email: string; /* email */
112
111
  roles: string[];
113
112
  static __is_atscript_annotated_type: true;
114
113
  static type: TAtscriptTypeObject<keyof InviteForm, InviteForm>;
@@ -143,7 +142,8 @@ declare class Select2faForm {
143
142
  declare class PincodeForm {
144
143
  // transportHint: ui.paragraph
145
144
  code: string;
146
- rememberDevice: boolean; // resend: ui.action
145
+ rememberDevice: boolean;
146
+ // resend: ui.action
147
147
  // useDifferentMethod: ui.action
148
148
  // useDifferentTransport: ui.action
149
149
  static __is_atscript_annotated_type: true;
@@ -161,8 +161,7 @@ declare class PincodeForm {
161
161
  */
162
162
  declare class AskEmailForm extends WithInlineConsentForm {
163
163
  // disclosure: ui.paragraph
164
- email: string;
165
- /* email */
164
+ email: string; /* email */
166
165
  static __is_atscript_annotated_type: true;
167
166
  static type: TAtscriptTypeObject<keyof AskEmailForm, AskEmailForm>;
168
167
  static metadata: TMetadataMap<AtscriptMetadata>;
@@ -193,7 +192,8 @@ declare class AskPhoneForm extends WithInlineConsentForm {
193
192
  * @see {@link ./forms.as:514:18}
194
193
  */
195
194
  declare class EnrollPickMethodForm {
196
- method: string; // skip: ui.action
195
+ method: string;
196
+ // skip: ui.action
197
197
  // cancel: ui.action
198
198
  static __is_atscript_annotated_type: true;
199
199
  static type: TAtscriptTypeObject<keyof EnrollPickMethodForm, EnrollPickMethodForm>;
@@ -209,7 +209,8 @@ declare class EnrollPickMethodForm {
209
209
  * @see {@link ./forms.as:548:18}
210
210
  */
211
211
  declare class EnrollAddressForm {
212
- address: string; // skip: ui.action
212
+ address: string;
213
+ // skip: ui.action
213
214
  // cancel: ui.action
214
215
  // useDifferentMethod: ui.action
215
216
  static __is_atscript_annotated_type: true;
@@ -227,7 +228,8 @@ declare class EnrollAddressForm {
227
228
  */
228
229
  declare class EnrollConfirmForm {
229
230
  // transportHint: ui.paragraph
230
- code: string; // resend: ui.action
231
+ code: string;
232
+ // resend: ui.action
231
233
  // useDifferentMethod: ui.action
232
234
  // cancel: ui.action
233
235
  // skip: ui.action
@@ -265,7 +267,8 @@ declare class EnrollTotpQrForm {
265
267
  declare class ManageMfaForm {
266
268
  // lockedNote: ui.paragraph
267
269
  // requiredNote: ui.paragraph
268
- operation: string; // cancel: ui.action
270
+ operation: string;
271
+ // cancel: ui.action
269
272
  static __is_atscript_annotated_type: true;
270
273
  static type: TAtscriptTypeObject<keyof ManageMfaForm, ManageMfaForm>;
271
274
  static metadata: TMetadataMap<AtscriptMetadata>;
@@ -296,7 +299,8 @@ declare class RemoveMfaConfirmForm {
296
299
  * @see {@link ./forms.as:744:18}
297
300
  */
298
301
  declare class PasswordReauthForm {
299
- password: string; // cancel: ui.action
302
+ password: string;
303
+ // cancel: ui.action
300
304
  static __is_atscript_annotated_type: true;
301
305
  static type: TAtscriptTypeObject<keyof PasswordReauthForm, PasswordReauthForm>;
302
306
  static metadata: TMetadataMap<AtscriptMetadata>;
@@ -405,7 +409,8 @@ declare class ChangePasswordForm {
405
409
  // intro: ui.paragraph
406
410
  currentPassword: string;
407
411
  newPassword: string;
408
- confirmPassword: string; // passwordRules: ui.paragraph
412
+ confirmPassword: string;
413
+ // passwordRules: ui.paragraph
409
414
  static __is_atscript_annotated_type: true;
410
415
  static type: TAtscriptTypeObject<keyof ChangePasswordForm, ChangePasswordForm>;
411
416
  static metadata: TMetadataMap<AtscriptMetadata>;
@@ -421,7 +426,8 @@ declare class ChangePasswordForm {
421
426
  */
422
427
  declare class ProveControlForm {
423
428
  // intro: ui.paragraph
424
- password: string; // cancel: ui.action
429
+ password: string;
430
+ // cancel: ui.action
425
431
  static __is_atscript_annotated_type: true;
426
432
  static type: TAtscriptTypeObject<keyof ProveControlForm, ProveControlForm>;
427
433
  static metadata: TMetadataMap<AtscriptMetadata>;
@@ -437,7 +443,8 @@ declare class ProveControlForm {
437
443
  */
438
444
  declare class ProveControlOtpForm {
439
445
  // intro: ui.paragraph
440
- code: string; // resend: ui.action
446
+ code: string;
447
+ // resend: ui.action
441
448
  // cancel: ui.action
442
449
  static __is_atscript_annotated_type: true;
443
450
  static type: TAtscriptTypeObject<keyof ProveControlOtpForm, ProveControlOtpForm>;
@@ -465,5 +472,6 @@ declare class AuthorizeConsentForm {
465
472
  /** @deprecated Example Data support is disabled. To enable, set `exampleData: true` in tsPlugin options. */
466
473
  static toExampleData?: () => any;
467
474
  }
475
+ // prettier-ignore-end
468
476
  //#endregion
469
477
  export { AskEmailForm, AskPhoneForm, AuthorizeConsentForm, ChangePasswordForm, ConcurrencyLimitForm, EmailIdentifierForm, EnrollAddressForm, EnrollConfirmForm, EnrollPickMethodForm, EnrollTotpQrForm, InviteForm, LoginCredentialsForm, MagicLinkRequestForm, ManageMfaForm, MfaCodeForm, PasswordReauthForm, PincodeForm, ProveControlForm, ProveControlOtpForm, RecoveryFactorForm, RecoveryModeSelectForm, RemoveMfaConfirmForm, Select2faForm, SetPasswordForm, SignupForm, StepUpConfirmForm, TermsBumpForm, WithInlineConsentForm };
package/dist/index.d.mts CHANGED
@@ -8,7 +8,6 @@ import { MoostWf, WfOutlet, WfOutletTokenConfig, WfStateStrategy } from "@moostj
8
8
  import { FederatedLoginService, NormalizedProfile, OAuthProviderRegistry } from "@aooth/idp";
9
9
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
10
10
  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";
11
-
12
11
  //#region src/auth.config.d.ts
13
12
  /** Resolved cookie attributes. Same shape is used for both access + refresh. */
14
13
  interface ResolvedAuthCookieConfig {
@@ -195,18 +194,6 @@ interface WfFinishedResponse {
195
194
  options?: Record<string, unknown>;
196
195
  }>;
197
196
  }
198
- /**
199
- * Composable to set the completion response for a finished workflow.
200
- *
201
- * @example
202
- * ```ts
203
- * // Redirect after login
204
- * useWfFinished().set({ type: 'redirect', value: '/dashboard' })
205
- *
206
- * // Return data
207
- * useWfFinished().set({ type: 'data', value: { success: true } })
208
- * ```
209
- */
210
197
  //#endregion
211
198
  //#region src/auth.dto.d.ts
212
199
  /** POST /auth/refresh request body. Falls back to the refresh cookie when absent. */
@@ -922,7 +909,8 @@ declare const OAUTH_CSRF_COOKIE = "aooth_oauth";
922
909
  * caller-controlled (off for the http test harness, on in production).
923
910
  */
924
911
  declare function oauthCsrfCookieAttrs(opts: {
925
- secure: boolean; /** Cookie lifetime in seconds — match the signed-state TTL (default 600). */
912
+ secure: boolean;
913
+ /** Cookie lifetime in seconds — match the signed-state TTL (default 600). */
926
914
  maxAgeSec?: number;
927
915
  path?: string;
928
916
  }): TCookieAttributesInput;
@@ -2149,7 +2137,8 @@ interface AuthWorkflowOpts {
2149
2137
  mfa?: {
2150
2138
  pincodeLength?: number;
2151
2139
  pincodeTtlMs?: number;
2152
- pincodeResendTimeoutMs?: number; /** Max wrong-code submissions per minted pincode before the code is invalidated and the user must request a fresh one. Defaults to 5. */
2140
+ pincodeResendTimeoutMs?: number;
2141
+ /** Max wrong-code submissions per minted pincode before the code is invalidated and the user must request a fresh one. Defaults to 5. */
2153
2142
  pincodeMaxAttempts?: number;
2154
2143
  };
2155
2144
  /** Persisted-state TTL for the recovery flow — caps the window between OTP request and password reset. Applied at every recovery-side `requireInput` pause via the wf engine's `output.expires`. */
@@ -2178,7 +2167,8 @@ interface AuthWorkflowOpts {
2178
2167
  */
2179
2168
  deviceRecognition?: {
2180
2169
  cookieName?: string;
2181
- ttlMs?: number; /** Cap on the per-user `seenDevices` ledger — LRU-evicted beyond it. */
2170
+ ttlMs?: number;
2171
+ /** Cap on the per-user `seenDevices` ledger — LRU-evicted beyond it. */
2182
2172
  maxDevices?: number;
2183
2173
  };
2184
2174
  forms?: {
@@ -2188,24 +2178,34 @@ interface AuthWorkflowOpts {
2188
2178
  askEmail?: TAtscriptAnnotatedType;
2189
2179
  askPhone?: TAtscriptAnnotatedType;
2190
2180
  enrollPickMethod?: TAtscriptAnnotatedType;
2191
- enrollAddress?: TAtscriptAnnotatedType; /** TOTP QR step — shown before the code-entry pause (manage + opt-in). */
2181
+ enrollAddress?: TAtscriptAnnotatedType;
2182
+ /** TOTP QR step — shown before the code-entry pause (manage + opt-in). */
2192
2183
  enrollTotpQr?: TAtscriptAnnotatedType;
2193
- enrollConfirm?: TAtscriptAnnotatedType; /** Manage-MFA menu (Add / Change / Remove) shown after step-up. */
2194
- manageMfa?: TAtscriptAnnotatedType; /** Confirm-removal pause for the manage-MFA "Remove" action. */
2195
- removeMfaConfirm?: TAtscriptAnnotatedType; /** Password re-auth — step-up fallback when no factor is MFA-challengeable. */
2196
- passwordReauth?: TAtscriptAnnotatedType; /** Step-up dispatch consent — "we'll send a code to ma•••@x" notice before the step-up pincode send. */
2184
+ enrollConfirm?: TAtscriptAnnotatedType;
2185
+ /** Manage-MFA menu (Add / Change / Remove) shown after step-up. */
2186
+ manageMfa?: TAtscriptAnnotatedType;
2187
+ /** Confirm-removal pause for the manage-MFA "Remove" action. */
2188
+ removeMfaConfirm?: TAtscriptAnnotatedType;
2189
+ /** Password re-auth — step-up fallback when no factor is MFA-challengeable. */
2190
+ passwordReauth?: TAtscriptAnnotatedType;
2191
+ /** Step-up dispatch consent — "we'll send a code to ma•••@x" notice before the step-up pincode send. */
2197
2192
  stepUpConfirm?: TAtscriptAnnotatedType;
2198
2193
  select2fa?: TAtscriptAnnotatedType;
2199
2194
  mfaCode?: TAtscriptAnnotatedType;
2200
2195
  pincode?: TAtscriptAnnotatedType;
2201
- setPassword?: TAtscriptAnnotatedType; /** Authenticated self-service "change my password" form (current + new + confirm). */
2202
- changePassword?: TAtscriptAnnotatedType; /** Password-proof form rendered by `prove-control` when the matched account has a real password. */
2203
- proveControl?: TAtscriptAnnotatedType; /** OTP-proof form rendered by `prove-control` when the matched account is passwordless. */
2196
+ setPassword?: TAtscriptAnnotatedType;
2197
+ /** Authenticated self-service "change my password" form (current + new + confirm). */
2198
+ changePassword?: TAtscriptAnnotatedType;
2199
+ /** Password-proof form rendered by `prove-control` when the matched account has a real password. */
2200
+ proveControl?: TAtscriptAnnotatedType;
2201
+ /** OTP-proof form rendered by `prove-control` when the matched account is passwordless. */
2204
2202
  proveControlOtp?: TAtscriptAnnotatedType;
2205
2203
  termsBump?: TAtscriptAnnotatedType;
2206
2204
  concurrencyLimit?: TAtscriptAnnotatedType;
2207
- recoveryPincode?: TAtscriptAnnotatedType; /** Self-signup identifier form (`auth/signup/flow` entry pause). */
2208
- signup?: TAtscriptAnnotatedType; /** Consent prompt shown before `mint-authz-code` mints an auth code (AUTH-SERVER.md §6). */
2205
+ recoveryPincode?: TAtscriptAnnotatedType;
2206
+ /** Self-signup identifier form (`auth/signup/flow` entry pause). */
2207
+ signup?: TAtscriptAnnotatedType;
2208
+ /** Consent prompt shown before `mint-authz-code` mints an auth code (AUTH-SERVER.md §6). */
2209
2209
  authzConsent?: TAtscriptAnnotatedType;
2210
2210
  };
2211
2211
  }
@@ -2311,7 +2311,7 @@ type AuthDeliveryPayload = {
2311
2311
  recipient: string;
2312
2312
  deviceLabel?: string;
2313
2313
  loginAt: number;
2314
- }
2314
+ } |
2315
2315
  /**
2316
2316
  * Consumer-triggered security notice (e.g. impossible-travel detected by a
2317
2317
  * `resolveRiskStepUp` override) — routed through the same `deliver()` as
@@ -2320,7 +2320,7 @@ type AuthDeliveryPayload = {
2320
2320
  * (distances, cities). NEVER auto-sent by the base class — only a consumer
2321
2321
  * call to `sendSecurityAlert` emits it.
2322
2322
  */
2323
- | {
2323
+ {
2324
2324
  kind: "security-alert";
2325
2325
  channel: "email";
2326
2326
  recipient: string;
package/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ import { createAsHttpOutlet, finishWf, handleAsOutletRequest, useAtscriptWf } fr
11
11
  import { EncapsulatedStateStrategy, MoostWf, Step, StepRetriableError, StepTTL, Workflow, WorkflowParam, WorkflowSchema, createEmailOutlet, 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.133.0/helpers/esm/decorate.js
14
+ //#region \0@oxc-project+runtime@0.140.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);
@@ -378,7 +378,7 @@ const Public = () => {
378
378
  */
379
379
  const UserId = () => Resolve(() => useAuth().getUserId());
380
380
  //#endregion
381
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateMetadata.js
381
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateMetadata.js
382
382
  function __decorateMetadata(k, v) {
383
383
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
384
384
  }
@@ -717,7 +717,7 @@ const CLIENT_REDIRECT_POLICY_TOKEN = "aooth:ClientRedirectPolicy";
717
717
  */
718
718
  const DYNAMIC_CLIENT_STORE_TOKEN = "aooth:DynamicClientStore";
719
719
  //#endregion
720
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateParam.js
720
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
721
721
  function __decorateParam(paramIndex, decorator) {
722
722
  return function(target, key) {
723
723
  decorator(target, key, paramIndex);
@@ -1020,7 +1020,7 @@ function mergeAuthWorkflowOpts(opts) {
1020
1020
  * declares one — or an attacker submits one as an extra field — the strip
1021
1021
  * applied at the workflow step blocks shadowing.
1022
1022
  */
1023
- const RESERVED_USER_KEYS = new Set([
1023
+ const RESERVED_USER_KEYS = /* @__PURE__ */ new Set([
1024
1024
  "roles",
1025
1025
  "version",
1026
1026
  "id",
@@ -2956,7 +2956,7 @@ let AuthWorkflow = _AuthWorkflow = class AuthWorkflow {
2956
2956
  const inferred = await this.inferAdminRoles({ email: ctx.email });
2957
2957
  if (inferred.length === 0) return void 0;
2958
2958
  const admin = ctx.admin ??= {};
2959
- const merged = new Set([...admin.roles ?? [], ...inferred]);
2959
+ const merged = /* @__PURE__ */ new Set([...admin.roles ?? [], ...inferred]);
2960
2960
  admin.roles = Array.from(merged);
2961
2961
  }
2962
2962
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aooth/auth-moost",
3
- "version": "0.1.57",
3
+ "version": "0.1.59",
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.128",
60
+ "@atscript/moost-wf": "^0.1.130",
61
61
  "@wooksjs/http-body": "^0.7.21",
62
- "@aooth/arbac-moost": "^0.1.57",
63
- "@aooth/auth": "0.1.57",
64
- "@aooth/user": "0.1.57",
65
- "@aooth/idp": "0.1.57"
62
+ "@aooth/arbac-moost": "^0.1.59",
63
+ "@aooth/auth": "0.1.59",
64
+ "@aooth/idp": "0.1.59",
65
+ "@aooth/user": "0.1.59"
66
66
  },
67
67
  "devDependencies": {
68
- "@atscript/core": "^0.1.85",
69
- "@atscript/typescript": "^0.1.85",
70
- "@atscript/ui": "^0.1.128",
71
- "@atscript/ui-fns": "^0.1.128",
72
- "@moostjs/event-http": "^0.6.33",
73
- "@moostjs/event-wf": "^0.6.33",
74
- "moost": "^0.6.33",
75
- "unplugin-atscript": "^0.1.85",
68
+ "@atscript/core": "^0.1.86",
69
+ "@atscript/typescript": "^0.1.86",
70
+ "@atscript/ui": "^0.1.130",
71
+ "@atscript/ui-fns": "^0.1.130",
72
+ "@moostjs/event-http": "^0.6.34",
73
+ "@moostjs/event-wf": "^0.6.34",
74
+ "moost": "^0.6.34",
75
+ "unplugin-atscript": "^0.1.86",
76
76
  "wooks": "^0.7.21"
77
77
  },
78
78
  "peerDependencies": {
79
- "@atscript/moost-wf": "^0.1.128",
80
- "@atscript/typescript": "^0.1.85",
81
- "@moostjs/event-http": "^0.6.33",
82
- "@moostjs/event-wf": "^0.6.33",
79
+ "@atscript/moost-wf": "^0.1.130",
80
+ "@atscript/typescript": "^0.1.86",
81
+ "@moostjs/event-http": "^0.6.34",
82
+ "@moostjs/event-wf": "^0.6.34",
83
83
  "@wooksjs/event-core": "^0.7.21",
84
84
  "@wooksjs/event-http": "^0.7.21",
85
85
  "@wooksjs/http-body": "^0.7.21",
86
- "moost": "^0.6.33"
86
+ "moost": "^0.6.34"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "@atscript/typescript": {