@aooth/auth-moost 0.1.85 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atscript/index.d.mts +42 -27
- package/dist/atscript/index.mjs +2 -2
- package/dist/{forms-B9-r2zT5.mjs → forms-C9Wey0e9.mjs} +14 -4
- package/dist/index.d.mts +358 -24
- package/dist/index.mjs +801 -330
- package/package.json +5 -5
- package/src/atscript/models/forms.as +26 -6
- package/src/atscript/models/forms.as.d.ts +42 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aooth/auth-moost",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Moost auth integration for aoothjs — AuthGuard interceptor, useAuth composable, REST endpoints, workflows",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aoothjs",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@atscript/moost-wf": "^0.1.160",
|
|
61
61
|
"@wooksjs/http-body": "^0.7.31",
|
|
62
|
-
"@aooth/arbac-moost": "^0.
|
|
63
|
-
"@aooth/
|
|
64
|
-
"@aooth/
|
|
65
|
-
"@aooth/user": "0.
|
|
62
|
+
"@aooth/arbac-moost": "^0.2.0",
|
|
63
|
+
"@aooth/idp": "0.2.0",
|
|
64
|
+
"@aooth/auth": "0.2.0",
|
|
65
|
+
"@aooth/user": "0.2.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@atscript/core": "^0.1.109",
|
|
@@ -65,6 +65,7 @@ export interface LoginCredentialsForm {
|
|
|
65
65
|
@ui.form.autocomplete 'username'
|
|
66
66
|
@meta.required
|
|
67
67
|
@expect.minLength 1
|
|
68
|
+
@expect.maxLength 256
|
|
68
69
|
username: string
|
|
69
70
|
|
|
70
71
|
@ui.form.order 20
|
|
@@ -291,7 +292,7 @@ export interface SetPasswordForm extends WithInlineConsentForm {
|
|
|
291
292
|
@meta.sensitive
|
|
292
293
|
@meta.required
|
|
293
294
|
@expect.minLength 8
|
|
294
|
-
@ui.form.validate '(v, data) => v === data.newPassword || "Passwords must match"'
|
|
295
|
+
@ui.form.validate '(v, data, ctx) => v === data.newPassword || ctx?.public?.messages?.PASSWORDS_DO_NOT_MATCH || "Passwords must match"'
|
|
295
296
|
confirmPassword: string
|
|
296
297
|
|
|
297
298
|
/**
|
|
@@ -322,10 +323,10 @@ export interface SetPasswordForm extends WithInlineConsentForm {
|
|
|
322
323
|
* Invite form — used by an admin to send an invite magic link.
|
|
323
324
|
*
|
|
324
325
|
* Bundled shape is intentionally minimal: email + roles. Admins who want to
|
|
325
|
-
* collect richer
|
|
326
|
-
* `
|
|
327
|
-
* extra fields
|
|
328
|
-
* (see `
|
|
326
|
+
* collect richer data per invitee replace this form via
|
|
327
|
+
* `AuthWorkflowOpts.forms.invite` (a form that `extends InviteForm`); the
|
|
328
|
+
* extra fields reach `prepareUser({ form })`, `inferAdminRoles({ form })` and
|
|
329
|
+
* `duplicateInviteCheck({ form })` (see `AuthWorkflow.prepareUser`).
|
|
329
330
|
*
|
|
330
331
|
* `@wf.context.pass 'public'` whitelists the workflow `ctx.admin` group so the
|
|
331
332
|
* `inviteAdminInviteForm` step can pass the role-picker options (via
|
|
@@ -355,6 +356,25 @@ export interface InviteForm {
|
|
|
355
356
|
roles: string[]
|
|
356
357
|
}
|
|
357
358
|
|
|
359
|
+
/**
|
|
360
|
+
* Invite accept — the invitee picks their own username (shown only when
|
|
361
|
+
* `AuthWorkflowOpts.inviteUsername` is `'choose'`). Runs before the
|
|
362
|
+
* password step; the invited email stays the correspondence address.
|
|
363
|
+
*/
|
|
364
|
+
@meta.label 'Choose your username'
|
|
365
|
+
@meta.description 'You will use it to sign in.'
|
|
366
|
+
@ui.form.submit.text 'Continue'
|
|
367
|
+
export interface InviteChooseUsernameForm {
|
|
368
|
+
@ui.form.order 10
|
|
369
|
+
@ui.form.type 'text'
|
|
370
|
+
@meta.label 'Username'
|
|
371
|
+
@ui.form.autocomplete 'username'
|
|
372
|
+
@meta.required
|
|
373
|
+
@expect.minLength 1
|
|
374
|
+
@expect.maxLength 256
|
|
375
|
+
username: string
|
|
376
|
+
}
|
|
377
|
+
|
|
358
378
|
/**
|
|
359
379
|
* Select an enrolled MFA method (Phase 4 `select2fa` step).
|
|
360
380
|
*
|
|
@@ -926,7 +946,7 @@ export interface ChangePasswordForm {
|
|
|
926
946
|
@meta.sensitive
|
|
927
947
|
@meta.required
|
|
928
948
|
@expect.minLength 8
|
|
929
|
-
@ui.form.validate '(v, data) => v === data.newPassword || "Passwords must match"'
|
|
949
|
+
@ui.form.validate '(v, data, ctx) => v === data.newPassword || ctx?.public?.messages?.PASSWORDS_DO_NOT_MATCH || "Passwords must match"'
|
|
930
950
|
confirmPassword: string
|
|
931
951
|
|
|
932
952
|
@ui.form.order 25
|
|
@@ -47,7 +47,7 @@ export declare class LoginCredentialsForm {
|
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Atscript interface **MfaCodeForm**
|
|
50
|
-
* @see {@link ./forms.as:
|
|
50
|
+
* @see {@link ./forms.as:137:18}
|
|
51
51
|
*/
|
|
52
52
|
export declare class MfaCodeForm {
|
|
53
53
|
// transportHint: ui.paragraph
|
|
@@ -66,7 +66,7 @@ export declare class MfaCodeForm {
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* Atscript interface **EmailIdentifierForm**
|
|
69
|
-
* @see {@link ./forms.as:
|
|
69
|
+
* @see {@link ./forms.as:174:18}
|
|
70
70
|
*/
|
|
71
71
|
export declare class EmailIdentifierForm {
|
|
72
72
|
email: string /* email */
|
|
@@ -83,7 +83,7 @@ export declare class EmailIdentifierForm {
|
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Atscript interface **SignupForm**
|
|
86
|
-
* @see {@link ./forms.as:
|
|
86
|
+
* @see {@link ./forms.as:206:18}
|
|
87
87
|
*/
|
|
88
88
|
export declare class SignupForm {
|
|
89
89
|
email: string /* email */
|
|
@@ -100,7 +100,7 @@ export declare class SignupForm {
|
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Atscript interface **SetPasswordForm**
|
|
103
|
-
* @see {@link ./forms.as:
|
|
103
|
+
* @see {@link ./forms.as:264:18}
|
|
104
104
|
*/
|
|
105
105
|
export declare class SetPasswordForm extends WithInlineConsentForm {
|
|
106
106
|
// intro: ui.paragraph
|
|
@@ -119,7 +119,7 @@ export declare class SetPasswordForm extends WithInlineConsentForm {
|
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
121
|
* Atscript interface **InviteForm**
|
|
122
|
-
* @see {@link ./forms.as:
|
|
122
|
+
* @see {@link ./forms.as:342:18}
|
|
123
123
|
*/
|
|
124
124
|
export declare class InviteForm {
|
|
125
125
|
email: string /* email */
|
|
@@ -134,9 +134,25 @@ export declare class InviteForm {
|
|
|
134
134
|
static toExampleData?: () => any
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Atscript interface **InviteChooseUsernameForm**
|
|
139
|
+
* @see {@link ./forms.as:367:18}
|
|
140
|
+
*/
|
|
141
|
+
export declare class InviteChooseUsernameForm {
|
|
142
|
+
username: string
|
|
143
|
+
static __is_atscript_annotated_type: true
|
|
144
|
+
static type: TAtscriptTypeObject<keyof InviteChooseUsernameForm, InviteChooseUsernameForm>
|
|
145
|
+
static metadata: TMetadataMap<AtscriptMetadata>
|
|
146
|
+
static validator: (opts?: Partial<TValidatorOptions>) => Validator<typeof InviteChooseUsernameForm>
|
|
147
|
+
/** @deprecated JSON Schema support is disabled. Calling this method will throw a runtime error. To enable, set `jsonSchema: 'lazy'` or `jsonSchema: 'bundle'` in tsPlugin options, or add `@emit.jsonSchema` annotation to individual interfaces. */
|
|
148
|
+
static toJsonSchema: () => any
|
|
149
|
+
/** @deprecated Example Data support is disabled. To enable, set `exampleData: true` in tsPlugin options. */
|
|
150
|
+
static toExampleData?: () => any
|
|
151
|
+
}
|
|
152
|
+
|
|
137
153
|
/**
|
|
138
154
|
* Atscript interface **Select2faForm**
|
|
139
|
-
* @see {@link ./forms.as:
|
|
155
|
+
* @see {@link ./forms.as:391:18}
|
|
140
156
|
*/
|
|
141
157
|
export declare class Select2faForm {
|
|
142
158
|
methodName: string
|
|
@@ -154,7 +170,7 @@ export declare class Select2faForm {
|
|
|
154
170
|
|
|
155
171
|
/**
|
|
156
172
|
* Atscript interface **PincodeForm**
|
|
157
|
-
* @see {@link ./forms.as:
|
|
173
|
+
* @see {@link ./forms.as:441:18}
|
|
158
174
|
*/
|
|
159
175
|
export declare class PincodeForm {
|
|
160
176
|
// transportHint: ui.paragraph
|
|
@@ -175,7 +191,7 @@ export declare class PincodeForm {
|
|
|
175
191
|
|
|
176
192
|
/**
|
|
177
193
|
* Atscript interface **AskEmailForm**
|
|
178
|
-
* @see {@link ./forms.as:
|
|
194
|
+
* @see {@link ./forms.as:480:18}
|
|
179
195
|
*/
|
|
180
196
|
export declare class AskEmailForm extends WithInlineConsentForm {
|
|
181
197
|
// disclosure: ui.paragraph
|
|
@@ -192,7 +208,7 @@ export declare class AskEmailForm extends WithInlineConsentForm {
|
|
|
192
208
|
|
|
193
209
|
/**
|
|
194
210
|
* Atscript interface **AskPhoneForm**
|
|
195
|
-
* @see {@link ./forms.as:
|
|
211
|
+
* @see {@link ./forms.as:510:18}
|
|
196
212
|
*/
|
|
197
213
|
export declare class AskPhoneForm extends WithInlineConsentForm {
|
|
198
214
|
// disclosure: ui.paragraph
|
|
@@ -209,7 +225,7 @@ export declare class AskPhoneForm extends WithInlineConsentForm {
|
|
|
209
225
|
|
|
210
226
|
/**
|
|
211
227
|
* Atscript interface **EnrollPickMethodForm**
|
|
212
|
-
* @see {@link ./forms.as:
|
|
228
|
+
* @see {@link ./forms.as:534:18}
|
|
213
229
|
*/
|
|
214
230
|
export declare class EnrollPickMethodForm {
|
|
215
231
|
method: string
|
|
@@ -227,7 +243,7 @@ export declare class EnrollPickMethodForm {
|
|
|
227
243
|
|
|
228
244
|
/**
|
|
229
245
|
* Atscript interface **EnrollAddressForm**
|
|
230
|
-
* @see {@link ./forms.as:
|
|
246
|
+
* @see {@link ./forms.as:568:18}
|
|
231
247
|
*/
|
|
232
248
|
export declare class EnrollAddressForm {
|
|
233
249
|
address: string
|
|
@@ -246,7 +262,7 @@ export declare class EnrollAddressForm {
|
|
|
246
262
|
|
|
247
263
|
/**
|
|
248
264
|
* Atscript interface **EnrollConfirmForm**
|
|
249
|
-
* @see {@link ./forms.as:
|
|
265
|
+
* @see {@link ./forms.as:614:18}
|
|
250
266
|
*/
|
|
251
267
|
export declare class EnrollConfirmForm {
|
|
252
268
|
// transportHint: ui.paragraph
|
|
@@ -267,7 +283,7 @@ export declare class EnrollConfirmForm {
|
|
|
267
283
|
|
|
268
284
|
/**
|
|
269
285
|
* Atscript interface **EnrollTotpQrForm**
|
|
270
|
-
* @see {@link ./forms.as:
|
|
286
|
+
* @see {@link ./forms.as:664:18}
|
|
271
287
|
*/
|
|
272
288
|
export declare class EnrollTotpQrForm {
|
|
273
289
|
// qrCode: ui.paragraph
|
|
@@ -286,7 +302,7 @@ export declare class EnrollTotpQrForm {
|
|
|
286
302
|
|
|
287
303
|
/**
|
|
288
304
|
* Atscript interface **ManageMfaForm**
|
|
289
|
-
* @see {@link ./forms.as:
|
|
305
|
+
* @see {@link ./forms.as:707:18}
|
|
290
306
|
*/
|
|
291
307
|
export declare class ManageMfaForm {
|
|
292
308
|
// lockedNote: ui.paragraph
|
|
@@ -305,7 +321,7 @@ export declare class ManageMfaForm {
|
|
|
305
321
|
|
|
306
322
|
/**
|
|
307
323
|
* Atscript interface **RemoveMfaConfirmForm**
|
|
308
|
-
* @see {@link ./forms.as:
|
|
324
|
+
* @see {@link ./forms.as:741:18}
|
|
309
325
|
*/
|
|
310
326
|
export declare class RemoveMfaConfirmForm {
|
|
311
327
|
// notice: ui.paragraph
|
|
@@ -322,7 +338,7 @@ export declare class RemoveMfaConfirmForm {
|
|
|
322
338
|
|
|
323
339
|
/**
|
|
324
340
|
* Atscript interface **PasswordReauthForm**
|
|
325
|
-
* @see {@link ./forms.as:
|
|
341
|
+
* @see {@link ./forms.as:764:18}
|
|
326
342
|
*/
|
|
327
343
|
export declare class PasswordReauthForm {
|
|
328
344
|
password: string
|
|
@@ -339,7 +355,7 @@ export declare class PasswordReauthForm {
|
|
|
339
355
|
|
|
340
356
|
/**
|
|
341
357
|
* Atscript interface **StepUpConfirmForm**
|
|
342
|
-
* @see {@link ./forms.as:
|
|
358
|
+
* @see {@link ./forms.as:795:18}
|
|
343
359
|
*/
|
|
344
360
|
export declare class StepUpConfirmForm {
|
|
345
361
|
// notice: ui.paragraph
|
|
@@ -357,7 +373,7 @@ export declare class StepUpConfirmForm {
|
|
|
357
373
|
|
|
358
374
|
/**
|
|
359
375
|
* Atscript interface **TermsBumpForm**
|
|
360
|
-
* @see {@link ./forms.as:
|
|
376
|
+
* @see {@link ./forms.as:823:18}
|
|
361
377
|
*/
|
|
362
378
|
export declare class TermsBumpForm extends WithInlineConsentForm {
|
|
363
379
|
static __is_atscript_annotated_type: true
|
|
@@ -372,7 +388,7 @@ export declare class TermsBumpForm extends WithInlineConsentForm {
|
|
|
372
388
|
|
|
373
389
|
/**
|
|
374
390
|
* Atscript interface **ConcurrencyLimitForm**
|
|
375
|
-
* @see {@link ./forms.as:
|
|
391
|
+
* @see {@link ./forms.as:836:18}
|
|
376
392
|
*/
|
|
377
393
|
export declare class ConcurrencyLimitForm {
|
|
378
394
|
static __is_atscript_annotated_type: true
|
|
@@ -387,7 +403,7 @@ export declare class ConcurrencyLimitForm {
|
|
|
387
403
|
|
|
388
404
|
/**
|
|
389
405
|
* Atscript interface **MagicLinkRequestForm**
|
|
390
|
-
* @see {@link ./forms.as:
|
|
406
|
+
* @see {@link ./forms.as:846:18}
|
|
391
407
|
*/
|
|
392
408
|
export declare class MagicLinkRequestForm {
|
|
393
409
|
identifier: string
|
|
@@ -403,7 +419,7 @@ export declare class MagicLinkRequestForm {
|
|
|
403
419
|
|
|
404
420
|
/**
|
|
405
421
|
* Atscript interface **RecoveryModeSelectForm**
|
|
406
|
-
* @see {@link ./forms.as:
|
|
422
|
+
* @see {@link ./forms.as:861:18}
|
|
407
423
|
*/
|
|
408
424
|
export declare class RecoveryModeSelectForm {
|
|
409
425
|
mode: string
|
|
@@ -419,7 +435,7 @@ export declare class RecoveryModeSelectForm {
|
|
|
419
435
|
|
|
420
436
|
/**
|
|
421
437
|
* Atscript interface **RecoveryFactorForm**
|
|
422
|
-
* @see {@link ./forms.as:
|
|
438
|
+
* @see {@link ./forms.as:884:18}
|
|
423
439
|
*/
|
|
424
440
|
export declare class RecoveryFactorForm {
|
|
425
441
|
factor: string
|
|
@@ -436,7 +452,7 @@ export declare class RecoveryFactorForm {
|
|
|
436
452
|
|
|
437
453
|
/**
|
|
438
454
|
* Atscript interface **ChangePasswordForm**
|
|
439
|
-
* @see {@link ./forms.as:
|
|
455
|
+
* @see {@link ./forms.as:918:18}
|
|
440
456
|
*/
|
|
441
457
|
export declare class ChangePasswordForm {
|
|
442
458
|
// intro: ui.paragraph
|
|
@@ -456,7 +472,7 @@ export declare class ChangePasswordForm {
|
|
|
456
472
|
|
|
457
473
|
/**
|
|
458
474
|
* Atscript interface **ProveControlForm**
|
|
459
|
-
* @see {@link ./forms.as:
|
|
475
|
+
* @see {@link ./forms.as:983:18}
|
|
460
476
|
*/
|
|
461
477
|
export declare class ProveControlForm {
|
|
462
478
|
// intro: ui.paragraph
|
|
@@ -474,7 +490,7 @@ export declare class ProveControlForm {
|
|
|
474
490
|
|
|
475
491
|
/**
|
|
476
492
|
* Atscript interface **ProveControlOtpForm**
|
|
477
|
-
* @see {@link ./forms.as:
|
|
493
|
+
* @see {@link ./forms.as:1018:18}
|
|
478
494
|
*/
|
|
479
495
|
export declare class ProveControlOtpForm {
|
|
480
496
|
// intro: ui.paragraph
|
|
@@ -493,7 +509,7 @@ export declare class ProveControlOtpForm {
|
|
|
493
509
|
|
|
494
510
|
/**
|
|
495
511
|
* Atscript interface **AuthorizeConsentForm**
|
|
496
|
-
* @see {@link ./forms.as:
|
|
512
|
+
* @see {@link ./forms.as:1070:18}
|
|
497
513
|
*/
|
|
498
514
|
export declare class AuthorizeConsentForm {
|
|
499
515
|
// notice: ui.paragraph
|